BAPI_PR_CREATE - Not able to create PR with specific fields

@ordo
@gabi_verzea
Hi ,
I am creating PR in SAP application using BAPI BAPI_PR_CREATE. However i noticed two issues while creating PR

  1. Material_no → There is specific Material no ( all Numeric digit) for which i am trying to create PR but failed and getting error : The material <1106861> does not exist or is not activated. However when i use SAP system and try to create PR with same material no , i am able to create PR successfully.
  2. Address → When i am trying to input Address in BAPI , PR is getting created but Address is not getting assigned instead giving me error when i open PR in SAP system . Error :

But when i try to assign address in SAP system manually i am able to create it successfully .

Please help here

regards
Pratik

Hi Pratik,

one issue I see right away is that the material number seems to be missing the leading "0"s. in total, you should have 18 digits. So instead of “1106861” it should be “000000000001106861”.

For the Address I am not sure . could be also the internal format, so maybe some leading “0” could be needed.

Gabi.

Hi Gabi,

Thanks for quick response !

one issue of address field has resolved , my address contains 7 digit and appended three zeros to make it 10 character and after that i can see address in PR.
However , same is not happening with material number , i tried converting material no into 18 character by appending 0s but still same error : material doesnt exist

Hi Pratik,

hmm, strange, for me the issue with the material number was always from the leading "0"s. Are the "0"s now at least appearing in the error message ?
Also, is the material extended on the right plant, the one in your PR ?

Gabi.

Hi Pratik,

to me it looks like both error messages are a result of incorrect parameters when calling the BAPI. With incorrect parameters some eventually required default parameters when calling the BAPI. Those parameters are set per default if creating the PR through the SAP GUI, but when calling the BAPI, you need to provide them.
As this may depend on the customization of your SAP system, I recommend to involve an SAP consultant for guidance on this.

Thomas

Hi Gabi,

My both issues has been resolved and both are related to “Convert into full length string by appending 0s”

yesterday i did convert material but into 17 length string instead of 18.

today i fixed it and it worked

2 Likes

happy it worked out :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.