‎2006 Feb 03 7:19 PM
Hi,
l used a BADI to populate custom table with information from delivery. Depending of some criteria.
Look like we can only use structure in OO to work with.
How can l add new row into Ztable ?
Robert
‎2006 Feb 03 7:30 PM
In OO environment:
you cannot use a table with header line & you cannot access a table directly.
You have to define a work area and use it to modify/update the internal/z-tables.
Syntax:
Modify ztable from wa_ztable.
Example From SAP Help:
DATA message_wa TYPE t100.
message_wa-sprsl = 'EN'.
message_wa-arbgb = 'MYMSGCLASS'.
message_wa-msgnr = '100'.
message_wa-text = 'Some new message ...'.
MODIFY t100 FROM message_wa.
‎2006 Feb 03 7:23 PM
Hi Robert,
Use 'Modify dbtable from WA' statement.
here WA is the structure & dbtable is ur custom ztable.
‎2006 Feb 03 7:30 PM
In OO environment:
you cannot use a table with header line & you cannot access a table directly.
You have to define a work area and use it to modify/update the internal/z-tables.
Syntax:
Modify ztable from wa_ztable.
Example From SAP Help:
DATA message_wa TYPE t100.
message_wa-sprsl = 'EN'.
message_wa-arbgb = 'MYMSGCLASS'.
message_wa-msgnr = '100'.
message_wa-text = 'Some new message ...'.
MODIFY t100 FROM message_wa.
‎2006 Feb 03 7:31 PM
Dear Robert,
Yes you have to object oriented programing inside BADI.
Use this sample it should help you.
DATA ztab_wa TYPE ztab.
ztab_wa -field1 = 'AAAA'.
ztab_wa -field2 = 'BBBB'.
ztab_wa -field3 = 'CCCC'.
ztab_wa -field4 = 'DDDD'.
INSERT INTO ztab VALUES ztab_wa.
hope this would help you.Do reward points for useful answers.
Regards,
Suresh.