You are on page 1of 14

11/27/2019 [TEST CASE]5.

Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki


Welcome to the new version of SAP Community Wiki: Learn What's New? and what has changed.
Pages / … / Construction of Process Instruction

[TEST CASE]5. Dynamic Function Call in PI Sheet


Created by Rachel Tang, last modified on May 16, 2015

Purpose
A SAP standard Function Module or customer created Function Module can be included in PI Sheet, they can be triggered within PI
Sheet to realize different functions. This pge is to explain how they are inculded and working in PI Sheet.

Overview
Demo the way of dynamic funtion call in PI Sheet.

<Definition of Test Function Module>


Definition of the function module in SE37

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 1/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

<Dynamic Function Call>


Structure of process instruction

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 2/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 3/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki
Result in PI Sheet:

The data entries are marked with red star because they are required entry in the Function Module definition.

Input all the values that are needed to call the function module. Then press the button to call
the function module and get result.

<Call Transaction in PI Sheet>


Structure of process instruction:

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 4/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

Result in PI Sheet:

Press button to call the transaction in a new session.

Related Content
Related Documents
Insert SAP Help links or other WIKI content link.
Please hyperlink the title of the related document
Example: Explanation about how to create a WIKI page

Related SAP Notes/KBAs


Insert links to any related SAP Notes/KBAs that support your topic or are related. Please hyperlink ONLY SAP Note or KBA number.
Example:
https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 5/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki
SAP Note 83020: What is consulting, what is support
SAP KBA 12345: This is an example KBA link
(Use the following Hyperlink with SAP Note/KBA number at end: https://service.sap.com/sap/support/notes/123456)
__________________________________________________________________________________________________________
Use this structure to help you compose your contributions for WIKI and at the same time will ensure spelling and grammar.
No labels

12 Comments
Hrishikesh Joshi
Hi Rachel,
This document helps me a lot. At present I am working on the browser based PI sheet. Facing one issue when I call the
FM into the PI sheet.
In the FM If the values are wrong for example; if the material is incorrect we are passing the error message in the FM, now
when this FM is Incorporated in PI category and when we simulate the same in PI sheet. At this point I am getting the error
message in the Dialogue box(which is correct as I am entering the wrong material). Even after that error message i could
be able to do the signature.

How to tackle this? means if FM is giving the error message that value still remain in that characteristic(which is marked
as Required) and User can be able to do the signature.

Ideally SAP has to clear that value after the error message from that characteristic or has to stop the signature as the
value entered in the characteristic is wrong.

Can you please help me how I can solve this issue. As most of the requirements required validations and in which FMs are
required.

Regards

Hrishikesh

Rachel Tang
Hi Hrishi,
Base on your information, I think when you pass the error message for the wrong material in the FM, the material is
accept still in the PI-Sheet screen. For your situation, have you considered of using validation function? That is you
do the validation for certain field in the PI-sheet with a function module, then if the field input is not qualified, it will
not be accepted further the PI-sheet will not be able to be completed and of course you can't sign a PI-sheet the
can't be completed.
I have also written a test case about validation function, you may find it in the same section.
Regards,
Rachel

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 6/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

Hrishikesh Joshi
Hi Rachel,
Now its working, what the changes I have made that.. instead of using the PPPI_FUNCTION_NAME, I used
PPPI_VALIDATION_FUNCTION. Along with this I have incorporated the characteristics
PPPI_TEXT_FOR_INVALID_INPUT and PPPI_ACCEPT_INVALID_INPUT with entry "Never Accept".
Now this is working as been expected. But there is one constraint I can see in the PPPI_VALIDATION_FUNCTION is that
you cannot use the PPPI_EVENT characteristic after that..because of this the Error message will come at the end of the
last characteristic i.e. UoM
Here is the example of simulation from PI
Material
Quantity
Unit of Measure
Now the error is triggering at the Unit of Measure and not at the Material because of PPPI_VALIDATION_FUNCTION
characteristic.
Can you tell me how can we get that error message at the material tab instead of the UoM tab.
Regards
Hrishikesh

Rachel Tang
Hi Hrishi,
Can you please let me know your whole design in the process instruction? I want to see how you write the
characteristics.
Regards,
Rachel

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 7/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

Hrishikesh Joshi
Hi Rachel,
Here are the values

PPPI_DATA_REQUEST_TYPE Repeated Data Request


PPPI_MAXIMUM_TABLE_SIZE 1
PPPI_MESSAGE_CATEGORY ZQTY
PPPI_INPUT_GROUP Qty Issued f
PPPI_VARIABLE ZP_1
PPPI_PROCESS_ORDER
PPPI_PHASE
PPPI_INPUT_REQUEST Material
PPPI_VARIABLE ZP_2
PPPI_REQUESTED_VALUE ZPPPI_MATERIAL_2
PPPI_INPUT_REQUEST Quantity
PPPI_REQUESTED_VALUE ZQUANTITY
PPPI_INPUT_REQUEST UoM
PPPI_REQUESTED_VALUE PPPI_UNIT_OF_MEASURE
PPPI_VALIDATION_FUNCTION ZCOMI_FUNCTION
PPPI_EXPORT_PARAMETER MATERIAL
PPPI_STRING_VARIABLE ZP_2
PPPI_TEXT_FOR_INVALID_INPUT Material does not belongs to Process order
PPPI_ACCEPT_INVALID_INPUT Never accept
At the time of simulation this invalid input text I can see at UoM column and not at the material column

PI sheet look like this

Material Quantity UoM

Deviation should be shown here At present deviation is coming here

Hope you understood.

Regards
Hrishikesh
Email: jhrishiin@gmail.com
P.S. If you can share your email address on my email would be very greatful.

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 8/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

Rachel Tang
Hi Hrishikesh,
I think you should write it like below:
PPPI_DATA_REQUEST_TYPE Repeated Data Request
PPPI_MAXIMUM_TABLE_SIZE 1
PPPI_MESSAGE_CATEGORY ZQTY
PPPI_INPUT_GROUP Qty Issued f
PPPI_VARIABLE ZP_1
PPPI_PROCESS_ORDER
PPPI_PHASE
PPPI_INPUT_REQUEST Material
PPPI_VARIABLE ZP_2
PPPI_REQUESTED_VALUE ZPPPI_MATERIAL_2
PPPI_VALIDATION_FUNCTION ZCOMI_FUNCTION
PPPI_EXPORT_PARAMETER MATERIAL
PPPI_STRING_VARIABLE ZP_2
PPPI_TEXT_FOR_INVALID_INPUT Material does not belongs to Process order
PPPI_ACCEPT_INVALID_INPUT Never accept
PPPI_INPUT_REQUEST Quantity
PPPI_REQUESTED_VALUE ZQUANTITY
PPPI_INPUT_REQUEST UoM
PPPI_REQUESTED_VALUE PPPI_UNIT_OF_MEASURE
You should write the validation fomula or function immediately after the you define the field.
Regards,
Rachel

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 9/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

Hrishikesh Joshi
Thanks Rachel,
I tried this combination as per your suggestion. But when I simulate it in PI sheet, I am getting
the below error. The same problem i have observed in this thread
https://scn.sap.com/thread/3172223 but cannot see solution for it. He also got eh error
message for the variable.

Required value ZP_2 does not exist; function is not carried out
Message no. CPOC215

Diagnosis
You have called one of the following functions in the PI sheet:
A dynamic function call
A calculation formula
A check formula or check function
A data access
However, the function cannot be carried out since value ZP_2 that is required for calling the
function does not exist.

Procedure
To carry out the function correctly, you must first complete all process steps that may contain
the required value.

But when I put this FM and its parameters at the end its working, only problem is that deviation
comes at the UoM because the FM and its parameters are at the end.

Request you to please guide.


Regards
Hrishikesh

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 10/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

Rachel Tang
Hi Hrishi,
Sorry, it should look like below:
PPPI_DATA_REQUEST_TYPE Repeated Data Request
PPPI_MAXIMUM_TABLE_SIZE 1
PPPI_MESSAGE_CATEGORY ZQTY
PPPI_INPUT_GROUP Qty Issued f
PPPI_VARIABLE ZP_1
PPPI_PROCESS_ORDER
PPPI_PHASE
PPPI_INPUT_REQUEST Material
PPPI_VARIABLE ZP_2
PPPI_REQUESTED_VALUE ZPPPI_MATERIAL_2
PPPI_VALIDATION_FUNCTION ZCOMI_FUNCTION
PPPI_EXPORT_PARAMETER MATERIAL
PPPI_STRING_VARIABLE X
PPPI_TEXT_FOR_INVALID_INPUT Material does not belongs to Process
order
PPPI_ACCEPT_INVALID_INPUT Never accept
PPPI_INPUT_REQUEST Quantity
PPPI_REQUESTED_VALUE ZQUANTITY
PPPI_INPUT_REQUEST UoM
PPPI_REQUESTED_VALUE PPPI_UNIT_OF_MEASURE
the defined variable can't be used in the function module immediately, you should use X
instead of the variable.

Hrishikesh Joshi
That is Amazing Rachel, Its Worked very well!!
Could you tell me the reason why we cannot put the same variable for example here ZP_2 in the FM, as when I used the
PPPI_FUNCTION_NAME I have to use the same variables in the FM export and import parameter?
Regards
Hrishikesh

Rachel Tang
Hi Hrishi,
This is a technical restriction, when you validate the current field, you can't use a defined parameter to pass the
value, you should use the system variable X instead, as the value you entered is not passed to the defined
parameter yet when the validation function is called. The other use is the same.
Regards,
Rachel

Hrishikesh Joshi
Thanks Rachel,
Your support helps me a lot to understand this. In future if I need help I will definitely contact you . Can you please share
your e-Mail on my official e-Mail: jhrishiin@gmail.com
Regards
Hrishikesh

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 11/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

Hrishikesh Joshi

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 12/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki
Hi Rachel,

Need your help


I am fetching the material, material description, qty and uom from the storage unit, here I have a validation is, when SU
does not belongs to it gives the error message, which is working fine when simulating the FM. In master recipe I want to
bring that error for which I have written the sequence as below

PPPI_DATA_REQUEST_TYPE Repeated Data Request

PPPI_MAXIMUM_TABLE_SIZE 999

PPPI_MESSAGE_CATEGORY ZXX1

PPPI_INPUT_GROUP Weigh & Dispense

PPPI_VARIABLE AB_41

PPPI_PROCESS_ORDER

PPPI_PHASE

PPPI_VARIABLE AB_42

PPPI_RESERVATION

PPPI_INPUT_REQUEST Blend

PPPI_REQUESTED_VALUE YBLEND

PPPI_INPUT_REQUEST SAP SU

PPPI_VARIABLE DK10

PPPI_REQUESTED_VALUE ZSAPSUNO

PPPI_VALIDATION_FUNCTION ZCPI_SHEET_NEW

PPPI_EXPORT_PARAMETER STORAGEUNIT

PPPI_STRING_VARIABLE X

PPPI_TEXT_FOR_INVALID_INPUT Invalid SU

PPPI_ACCEPT_INVALID_INPUT Never accept

PPPI_FUNCTION_NAME ZCPI_SHEET_NEW

PPPI_EVENT COMPLETING

PPPI_EXPORT_PARAMETER PROCESSORDER

PPPI_FLOAT_VARIABLE AB_41

PPPI_EXPORT_PARAMETER RSNUM

PPPI_FLOAT_VARIABLE AB_42

PPPI_IMPORT_PARAMETER MATERIAL

PPPI_STRING_VARIABLE DK20

PPPI_IMPORT_PARAMETER MATERIAL_DESCRIPTION

PPPI_STRING_VARIABLE DK30

PPPI_IMPORT_PARAMETER BATCH_NUMBER

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 13/14
11/27/2019 [TEST CASE]5. Dynamic Function Call in PI Sheet - ERP Manufacturing (PP) - Community Wiki

PPPI_STRING_VARIABLE DK40

PPPI_IMPORT_PARAMETER AVAILABLE_STOCK

PPPI_STRING_VARIABLE DK50

PPPI_IMPORT_PARAMETER UOM

PPPI_STRING_VARIABLE DK60

PPPI_OUTPUT_TEXT Material_____

PPPI_OUTPUT_VARIABLE DK20

PPPI_OUTPUT_TEXT Material Description__________

PPPI_OUTPUT_VARIABLE DK30

PPPI_OUTPUT_TEXT Batch______

PPPI_OUTPUT_VARIABLE DK40

PPPI_OUTPUT_TEXT Qty Weighed

PPPI_OUTPUT_VARIABLE DK50

PPPI_OUTPUT_TEXT UoM

PPPI_OUTPUT_VARIABLE DK60

PPPI_INPUT_REQUEST Signature

PPPI_REQUESTED_VALUE PPPI_SIGNATURE

When I simulate this I am not getting the invalid text message from the PI sheet.

Can you please check where I have to change

Regards
Hrishikesh

Privacy Terms of Use Legal Disclosure Copyright Trademark


Cookie Preferences

https://wiki.scn.sap.com/wiki/display/ERPMan/%5BTEST+CASE%5D5.+Dynamic+Function+Call+in+PI+Sheet 14/14

You might also like