cancel
Showing results for 
Search instead for 
Did you mean: 

Save data from table control to Ztables

sidda1196
Explorer
0 Kudos

Hi Experts! I need some help with the Module pool concept.

In my case, I have an input field 'Material Doc. No.' based on which I'm getting 'Creation Date', 'Gate Pass Number', and a few other line items from standard table MSEG into the table control 'tbctrl'.
Also, In my table control, I've added a few fields from the custom table which should be input enabled. Once I give the input values in table control those corresponding values should be stored in custom table against the 'Material Doc No' 'Creation Date' and 'Gate pass Number'.
Please guide me where to write the logic and how it works.
I've tried some logic and it stores the data in Z tables as below:
Mat Do. CDate. GP Num. Tbctrl-f1 Tbctrl-f2 Tbctrl-f3

1001 19.2.20 7894 XXX YYY ZZZ

0000 00.00.00 000 PPP QQQ RRR

I also need to fill the 2 and so on rows with the header input fields.

Please do the needful.

Sandra_Rossi
Active Contributor
0 Kudos
Mat Do.   CDate.      GP Num.   Tbctrl-f1   Tbctrl-f2   Tbctrl-f3
1001      19.02.20    7894      XXX         YYY         ZZZ
0000      00.00.00    000       PPP         QQQ         RRR

Accepted Solutions (1)

Accepted Solutions (1)

mateuszadamus
Active Contributor

Hello sidda1196

Please provide your code (using the "Code" button for formatting). It will make answering your query easier.

As to the missing key fields, you can always set them up just before updating the Z* table. Something like logic below:

LOOP AT itab REFERENCE INTO DATA(ld_row)
  WHERE key1 IS INITIAL
     OR key2 IS INITIAL
     OR key3 IS INITIAL.

  ld_row->key1 = value1.
  ld_row->key2 = value2.
  ld_row->key3 = value3.
ENDLOOP.
Kind regards,
Mateusz
sidda1196
Explorer

Thank you for the response, Mateusz.

Answers (0)