cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI - Custom fields

former_member534411
Participant
0 Kudos

Hi Guys:

I would like to use the BAPI of Sales order <b>BAPI_SALESORDER_CREATEFROMDAT2</b> and have small doubt in my mind. Already some Custom fields are added in the Sales Order item Level Additional <b>TabA and TabB</b>. How can i simulate the Custom fields to above mentioned BAPI. Is Userexit will solve the purpose of mine?

Suggestions are welcome.

Thanks in Advance

Regards

Suresh Babu Karanam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Suresh,

In the BAPI there is a table parameter EXTENSIONIN which you can use to pass the values for user defined fields to the BAPI..

For this first you will need to add these custom fields to the structure BAPE_VBAK or BAPE_VBAP or BAPE_VBEP etc.. depending on the table you have extended.. Then in the EXTENSIONIN table structure you'll need to specify the above structure name in the field EXTENSIONIN-STRUCTURE and the value of the fields added to the BAPE_VBAK or BAPE_VBAP or BAPE_VBEP structure in the field EXTENSIONIN-VALUEPART1.. The data in the field VALUEPART1 appears as a continuous string therefore the sequence and positioning of the values in this field for the custom fields you have added has to be correct. For eg. if the first field that you have added to the structure is of length 10 and the second field is of length 5 then the value for the first field will occupy the position 1 to 10 in the VALUEPART1 field and the second field value has to start from position 11 irrespective of the actual length of the value of the first field...

You can get more documentation on this in the documentation of the BAPI_SALESORDER_CREATEFROMDAT2 for the parameter EXTENSIONIN.. You can also check the documentation for the BAPI BAPI_MATERIAL_SAVEDATA for more clarity as the concept of passing values for custom fields to a BAPI ,if the EXTENSIONIN table parameter is provided, is the same with some minor differences..

Hope this helps you resolve you issue.

Cheers

Nitesh

Answers (1)

Answers (1)

former_member534411
Participant
0 Kudos

Thank you very much Netesh I will give points for your valuble information. I have just started the code on my requirement. Even i red the OSS note for this Custum fields in the SD-BAPI. They clearly specify that custum fields should only <b>char</b>. But i would like use <b>Curr</b> fields. Can i convert <b>Curr to Char?</b>.

Regards

Suresh Babu Karanam

Former Member
0 Kudos

Hi Suresh,

Declare the currency field as a char field in the BAPI structure you'll be extending and hopefully that should work.

Cheers

Nitesh