Application Development and Automation 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: 
Read only

reading field from screen

Former Member
0 Likes
590

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

4 REPLIES 4
Read only

Former Member
0 Likes
558

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

Read only

Former Member
0 Likes
558

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....

Read only

Former Member
0 Likes
558

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

Read only

Former Member
0 Likes
558

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