cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_REQUISITION_CREATE is working in SE37 but is only partially working through program

amar2307
Explorer
0 Kudos
114

Hi everyone,

This is my first post so I might not come across very clearly. Please bear with me.

I am using 'BAPI_REQUISITION_CREATE' to create a PR in EBAN table, which also contains ADRNR/ADRN2 fields.

My requirement states that the ADRNR/ADRN2 field should get auto-generated in the record once the BAPI is executed, and I will then update the same ADRNR into ADRC table manually.

I read that the prerequisite for this requirement is that the REQUISITION_ADDRDELIVERY structure should be populated, and I am doing the same.

However, once the BAPI is executed through my program, the PR is generated with empty ADRNR/ADRN2 fields. If I execute the same BAPI through SE37 using the same inputs, the ADRNR field is being populated.

Any ideas on where I might be going wrong?

Thank you

Sandra_Rossi
Active Contributor
Following Raymond explanations, when running the test via SE37, see the entered values by debug at the beginning of the function module, you will see how they have been converted by the conversion exits.
View Entire Topic
raymond_giuseppi
Active Contributor

Usually, if it works with SE37 in test mode and not in a program, it's often due to a data format error.

  • SE37 uses conversion exits attached to domains, to convert a readable/external format into an internal format
  • The program passes the data as received
  • Check your data format, and use FMs such as CONVERSION_EXIT_ALPHA_INPUT to correct wrong values.
  • Call BAPI_REQUISITION_GETDETAIL to get correct formats from an existing data