Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Extension Values

Former Member
0 Kudos

Iam changing a contract and updating the tables using BAPI BAPI_CUSTOMERCONTRACT_CHANGE.

Here iam facing the probelm while passing the BAPI Extension values.

Can you please advice how we need to pass the entire item data into VALUEPARTx fields .

Please find my code here :

W_EXTENSIONIN-STRUCTURE = 'BAPE_VBAP'.

W_ADDITIONAL-ZZ_KUNNR1 = W_FINAL-ZZ_KUNNR1.

W_ADDITIONAL-ZZ_KUNNR2 = W_FINAL-ZZ_KUNNR2.

W_ADDITIONAL-ZZ_KUNNR3 = W_FINAL-ZZ_KUNNR3.

W_ADDITIONAL-ZZ_KUNNR4 = W_FINAL-ZZ_KUNNR4.

W_ADDITIONAL-ZZ_KUNNR5 = W_FINAL-ZZ_KUNNR5.

W_ADDITIONAL-ZZ_KUNNR6 = W_FINAL-ZZ_KUNNR6.

W_ADDITIONAL-ZZ_KUNNR7 = W_FINAL-ZZ_KUNNR7.

W_ADDITIONAL-ZZ_KUNNR8 = W_FINAL-ZZ_KUNNR8.

W_ADDITIONAL-ZZ_KUNNR9 = W_FINAL-ZZ_KUNNR9.

W_ADDITIONAL-ZZ_MONDEPOT = W_FINAL-ZZ_MONDEPOT.

W_ADDITIONAL-ZZ_TUEDEPOT = W_FINAL-ZZ_TUEDEPOT.

W_ADDITIONAL-ZZ_WEDDEPOT = W_FINAL-ZZ_WEDDEPOT.

W_ADDITIONAL-ZZ_THUDEPOT = W_FINAL-ZZ_THUDEPOT.

W_ADDITIONAL-ZZ_FRIDEPOT = W_FINAL-ZZ_FRIDEPOT.

W_ADDITIONAL-ZZ_SATDEPOT = W_FINAL-ZZ_SATDEPOT.

W_ADDITIONAL-ZZ_SUNDEPOT = W_FINAL-ZZ_SUNDEPOT.

W_ADDITIONAL-ZZ_BANKDEPOT = W_FINAL-ZZ_BANKDEPOT.

W_ADDITIONAL-ZZ_SCH_ADHOC_DEP = W_FINAL-ZZ_SCH_ADHOC_DEP.

CONCATENATE W_FINAL-VBELN

W_FINAL-POSNR

W_ADDITIONAL

INTO W_EXTENSIONIN-VALUEPART1.

APPEND W_EXTENSIONIN TO IT_EXTENSIONIN.

But here the total line item data is not coming into the VALUEPART1 filed.

How we will distribute the line item data into VALUEPARTx fields .

Please advice?

Edited by: vinay raj on Feb 15, 2011 5:53 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Check out SAP help,

In situations where the remaining capacity of VALUEPART1 (for example) is less than the maximum length of the next table field to add, then the value of this table field is split between VALUEPART1 and VALUEPART2. As much of the value as fits is saved in VALUEPART 1, and the rest is allocated to VALUEPART2.

http://help.sap.com/saphelp_46c/helpdata/en/c3/40999d8b8911d396b70004ac96334b/frameset.htm

use Max's example in the below thread,

BAPIPAREX+30 = BAPE_VBAP.

3 REPLIES 3

Former Member
0 Kudos

Check out SAP help,

In situations where the remaining capacity of VALUEPART1 (for example) is less than the maximum length of the next table field to add, then the value of this table field is split between VALUEPART1 and VALUEPART2. As much of the value as fits is saved in VALUEPART 1, and the rest is allocated to VALUEPART2.

http://help.sap.com/saphelp_46c/helpdata/en/c3/40999d8b8911d396b70004ac96334b/frameset.htm

use Max's example in the below thread,

BAPIPAREX+30 = BAPE_VBAP.

0 Kudos

Hi Krish,

Thanks for your information.

But do we need to pass again the VBELN and POSNR number again into VALUEPART2.

0 Kudos

Nope, you don't need to pass it to value-part2... Basically the quote from SAP help is pretty straight forward...

If for example, you have 10 fields in BAPI_VBAP making a total of 242 char... Last field is 3 character... You have to basically fill value-part1 with all but two character of BAPI_VBAP... AND then fill the remaining 2 characters in VALUE-PART2... Max has a pretty simple method to do this by filling from 31st position all the characters in BAPI_VBAP...

If you are not comfortable with this approach, Then you can create two structures,

STRUCTURE 'A' with two fields 30 characters and second field with 960 characters.. Move your BAPI_VBAP to the second field and structure name to first field... Once the move is complete, move the entire structure to BAPIPAREX...

If your system is unicode compliant, check out this wiki link for character conversion

http://wiki.sdn.sap.com/wiki/display/SI/UCCHECK(UnicodeComplaince)-CommonErrorsand+Solutions