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: 

Modify Partner field in VT02N through BADI_LE_SHIPMENT

Former Member
0 Kudos

Hello,

I am working on the enhancement BADI 'BADI_LE_SHIPMENT' and the requirement is to populate fields At SAVE method. the fields are

1) Supplement 1 field under Additional data tab, which i have done succesfully.

2) the other two fields are a) PARTNER TYPE (PARVW) and b) PARTNER under the Partner tab.

i have found out that the value of deep structure Cha_shipment_At_Save consists of the table new_vbap and the fiedls to be modified are LIFNR and PARVW, but the code is not changing or appending any records to the desired fields.

is there another table which i have to look. i tried that to but to no avail. kindly help me in resolving this issue at the earliest..

thanks,

Rohan

1 ACCEPTED SOLUTION

former_member262988
Active Contributor
0 Kudos

Hi ,

Create a table of type deep structure ...........like

data : LIT_EMP_DYNAMIC_TABLE of type <deep structure>.

data : new_emp TYPE REF TO cl_abap_typedescr, new_emp_tab TYPE REF TO cl_abap_tabledescr.

new_emp = cl_abap_structdescr=>describe_by_data_ref( <table name>).

new_emp_tab ?= new_emp.

fill the table <table name> with desired values.

pass this table to exporting parameter CHA_SHIPMENTS_AT_SAVE .....

like CHA_SHIPMENTS_AT_SAVE-NEW_VTTK ......(for example)

Thanks,

Shailaja Ainala.

3 REPLIES 3

former_member262988
Active Contributor
0 Kudos

Hi ,

Create a table of type deep structure ...........like

data : LIT_EMP_DYNAMIC_TABLE of type <deep structure>.

data : new_emp TYPE REF TO cl_abap_typedescr, new_emp_tab TYPE REF TO cl_abap_tabledescr.

new_emp = cl_abap_structdescr=>describe_by_data_ref( <table name>).

new_emp_tab ?= new_emp.

fill the table <table name> with desired values.

pass this table to exporting parameter CHA_SHIPMENTS_AT_SAVE .....

like CHA_SHIPMENTS_AT_SAVE-NEW_VTTK ......(for example)

Thanks,

Shailaja Ainala.

Former Member
0 Kudos

Hi Rohan,

Did u solved this issue? If so could you please let me know how.

I tried to update the save field values from BADI but it is not updating these field values to table.

Thanks.

Former Member
0 Kudos

Hi Rohan, the solution is when you fill the data in the structure cha_shipments_at_save-new_vbpa[].


Make sure to fill the field UPDKZ  with an 'I' or 'U' before appending the information.

                                   "insert or update flag before

w_vbpa-mandt = sy-mandt.            " Client

w_vbpa-vbeln = fp_w_vttk-tknum. " Shipment

w_vbpa-parvw = l_c_char_sp.       " Partner

w_vbpa-lifnr = fp_w_vttk-tdlnr.      " Fordwaring Agent      (in my case)

w_vbpa-updkz = l_c_i.                 " Insert entry in table.


APPEND w_vbpa TO cha_shipments_at_save-new_vbpa[].


Best regards.

Nicolas.