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: 

Problem with BAPI_SALESORDER_CHANGE - Extensionin

Former Member
0 Kudos

Dear Experts,

I am facing a problem with BAPI_SALESORDER_CHANGE - Tables - EXTENSIONIN.

I need to update the Truck Number in Sales Order.

My code involves as :

DATA : WS_BAPE_VBAP TYPE BAPE_VBAP,

           WS_BAPE_VBAPX TYPE BAPE_VBAPX,

   

           WT_EXTENSIONIN TYPE STANDARD TABLE FO BAPIPAREX WITH HEADER LINE.

WT_EXTENSIONIN-STRUCTURE = BAPE_VBAP.

WS_BAPE_VBAP-VBELN          = WS-VBAP-VBELN.

WS_BAPE_VBAP-POSNR         = WS_VBAP-POSNR.

WS_BAPE_VBAP-OIC_TRUCKN = '8005A'.

WT_EXTENSIONIN-VALUEPART1 = WS_BAPE_VBAP.

APPEND WT_EXTENSIONIN.

WT_EXTENSIONIN-STRUCTURE = BAPE_VBAPXO.

WS_BAPE_VBAPX-VBELN          = WS-VBAP-VBELN.

WS_BAPE_VBAPX-POSNR         = WS_VBAP-POSNR.

WS_BAPE_VBAPX-OIC_TRUCKN = '8005A'.

WT_EXTENSIONIN-VALUEPART1 = WS_BAPE_VBAPX.

APPEND WT_EXTENSIONIN.

and i am calling BAPI_SALESORDER_CHANGE.

But in table EXTENSIONIN-VALUEPART1 is having the lenght of 240, but what the field i want to update with values is beyond 240 length. This is the reason i am unable to update the value in SO. Even in debugging also, i cannt find the value of OIC_TRUCKN, even i pass with value.

Kindly help me to solve this issue.

Thanks & Regards,

Srinivas

1 ACCEPTED SOLUTION

Former Member
0 Kudos

sorry, its above the lenght 240. I search in SDN for my solution, but unable to get exact solution, i found in SDN all threads are involved in updating the Z or Y fields.

please help me to solve my issue.

Thanks & Regards,

Srinivas

5 REPLIES 5

Former Member
0 Kudos

sorry, its above the lenght 240. I search in SDN for my solution, but unable to get exact solution, i found in SDN all threads are involved in updating the Z or Y fields.

please help me to solve my issue.

Thanks & Regards,

Srinivas

0 Kudos

Hi Srini,

Extension structure is for changing customer added fields in VBAK&VBAP tables. So all threads are about updating Z fields.

Can you try as below.

     WS_BAPE_VBAP-VBELN                 = WS-VBAP-VBELN.

    WS_BAPE_VBAP-posnr              = WS_VBAP-POSNR.

    WS_BAPE_VBAP-OIC_TRUCKN   = '8005A'.

    WT_EXTENSIONIN-structure       = 'BAPE_VBAP'.

    WT_EXTENSIONIN+30               = WS_BAPE_VBAP.

    APPEND WT_EXTENSIONIN.

    CLEAR WT_EXTENSIONIN.

     WS_BAPE_VBAPx-VBELN                 = WS-VBAP-VBELN.

    WS_BAPE_VBAPx-posnr              = WS_VBAP-POSNR.

    WS_BAPE_VBAPx-OIC_TRUCKN  = 'X'.

    WT_EXTENSIONIN-structure        = 'BAPE_VBAPX'.

    WT_EXTENSIONIN+30                = WS_BAPE_VBAPx.

    APPEND WT_EXTENSIONIN.

    CLEAR WT_EXTENSIONIN.

0 Kudos

Hi Basar,

Thank you for your reply, its working, i am able to update the Truck information.

One small query, In WT_EXTENSIONIN+30, Instead of 30, if i take as 100, its taking default as 30, will you please tell me why it taking default as 30, even i pass 100.

Thanks & Regards,

Srinivas

0 Kudos

Hi Srini,

I'm glad you solve the problem.

if you check structure of extensionin you will see that first 30 character belongs to component "STRUCTURE", After that VALUEPARTS begin. So you have to assign variables after 30th character. When you set 100 instead of 30, it is still go into to valupart1, maybe function do a condense in valueparts.

0 Kudos

Hi Basar,

Thanks for your reply, i got the point why it is taking default 30 as extension length.

Previous i pass the value by defining +30, but my mistake i made is, passed the structure instead of work area.

    WT_EXTENSIONIN-structure       = 'BAPE_VBAP'.

    WT_EXTENSIONIN+30               = WS_BAPE_VBAP.  (Correct)

    WT_EXTENSIONIN+30               = BAPE_VBAP.    (Incorrect).

Thanks & Regards,

Srinivas