2008 Jan 23 9:49 AM
Hi Experts,
I have fetched the records from ztable and shown on screen.. it has five columns. In Qty column few cells has entry & few dont have. The cells which has entries are in disable mode and rest are in input mode for user to enetr qty.
After that I need to save the records only which are in input mode. What is the condition for that.
Initially I am using below code to read the field value for all rows.
LOOP AT ITAB.
line_num = 11 + N.
READ LINE line_num FIELD VALUE ITAB-WERKS ITAB-MONTH ITAB-MATNR ITAB-MAKTX XMENGE ITAB-MEINS.
ZFORDATA-WERKS = ITAB-WERKS.
ZFORDATA-ZMONTH = ITAB-MONTH.
ZFORDATA-ZYEAR = ITAB-YEAR.
ZFORDATA-MATNR = ITAB-MATNR.
ZFORDATA-MAKTX = ITAB-MAKTX.
ZFORDATA-PQTY = ITAB-MENGE.
ZFORDATA-MEINS = ITAB-MEINS.
INSERT ZFORDATA.
XMSG = 'X'.
n = n + 2.
ENDLOOP.
******************************************************
PLZ HELP. URGENT.
kHAN
Hi Experts,
I have fetched the records from ztable and shown on screen.. it has five columns. In Qty column few cells has entry & few dont have. The cells which has entries are in disable mode and rest are in input mode for user to enetr qty.
After that I need to save the records only which are in input mode. What is the condition for that.
Initially I am using below code to read the field value for all rows.
LOOP AT ITAB.
line_num = 11 + N.
READ LINE line_num FIELD VALUE ITAB-WERKS ITAB-MONTH ITAB-MATNR ITAB-MAKTX XMENGE ITAB-MEINS.
ZFORDATA-WERKS = ITAB-WERKS.
ZFORDATA-ZMONTH = ITAB-MONTH.
ZFORDATA-ZYEAR = ITAB-YEAR.
ZFORDATA-MATNR = ITAB-MATNR.
ZFORDATA-MAKTX = ITAB-MAKTX.
ZFORDATA-PQTY = ITAB-MENGE.
ZFORDATA-MEINS = ITAB-MEINS.
INSERT ZFORDATA.
XMSG = 'X'.
n = n + 2.
ENDLOOP.
******************************************************
PLZ HELP. URGENT.
kHAN
2008 Jan 23 10:07 AM
take on e more field of checkbox user shud check before entering quantity
then
loop at itab where checkbox = 'x'.
modify itab.
endloop.
hope this is useful
plz.reward
regards
vivek
2008 Jan 23 10:12 AM
khan,
In your output add checkbox field to each record as first fields.
READ LINE line_num FIELD VALUE ITAB-WERKS ITAB-MONTH ITAB-MATNR ITAB-MAKTX XMENGE ITAB-MEINS where checkbox = 'X'.
now you will get the records.
Don't forget to reward if useful....
2008 Jan 23 10:17 AM
Hi,
Use another internal as check table.
At the start when you select data in ITAB ,store ITAB int IT_CHKTAB.
i.e. IT_CHKTAB[] = ITAB[].
When you are updating database table....
loop at ITAB into WA_TAB.
Ind = sy-tabix.
read table IT_CHKTAB into wa_CHKTAB index Ind.
if WA_CHKTAB NE WA_TAB.
wa_ZFORDATA-WERKS = wa_ITAB-WERKS.
wa_ZFORDATA-ZMONTH = wa_ITAB-MONTH.
wa_ZFORDATA-ZYEAR = wa_ITAB-YEAR.
wa_ZFORDATA-MATNR = wa_ITAB-MATNR.
wa_ZFORDATA-MAKTX = wa_ITAB-MAKTX.
wa_ZFORDATA-PQTY = wa_ITAB-MENGE.
wa_ZFORDATA-MEINS = wa_ITAB-MEINS.
Update ZFORDATA from wa_ZFORDATA.
clear : wa_ITAB, wa_CHKTAB, wa_ZFORDATA.
endif.
endloop.
Edited by: sagar kekare on Jan 23, 2008 3:49 PM
2008 Jan 23 10:37 AM
SELF ANSWERED..........Adding 1 more column in ITAB and check X where ever menge field is filled while fetching data from DB table.
Thanks to all for help
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |