‎2011 Feb 14 10:46 AM
Hi,
I am working on module pool program. The below is my code. Here itab it_articles is a table control. I entered two records while running and when I checked in debugging mode this table does not have my two records but still it loops and control goes inside the loop. But the header field it_articles-ean11 have value.
My requirement is to get all the articles to make a select from another standard table. I dont want to put the select inside the loop. But here since itab it_articles does not have any value at the beginning, I am not able to use it before the looping. Any advice.
LOOP AT it_articles. "no value in it_articles and still it loops
CHAIN.
FIELD it_articles-ean11 "Value is there in header it_articles-ean11
MODULE get_article ON INPUT.
ENDCHAIN.
ENDLOOP.
‎2011 Feb 14 11:22 AM
Hi Vinraj,
Your requirment is not clear. But as per my understanding you need record from table control to your varibal.
You should write loop endloop to internal table in PBO and PAI event rather loop at table control in PAI.
If you want data from table control then in PAI event you should write
loop at itab.
module update.
endloop.
Module update.
wa_itab to itab.
***********
likewise you are transfering your table control data to internal table . Now you can use article field data from internal table
Thanks,
Nilima
‎2011 Feb 14 11:51 AM
Hello You need to add below code in PBO and PAI respectively.
PBO.
LOOP AT IT_ARTICLES WITH CONTROL TC1 CURSOR TC1-TOP_LINE.
MODULE <Get Article>.
ENDLOOP.
Where : TC1 is your table control name on the screen
Inside the module add code to move data from IT_ARTICLES to Screen field/table control fields
PAI.
LOOP AT IT_ARTICLES.
ENDLOOP.Hope this helps
Regards
Shiva
‎2011 Feb 14 3:56 PM
Hi!
Try this
process before output.
module status_2000.
module initialization.
module exit at exit-command.
loop at itab2.
module check_values.
module check_table. <----
endloop.
module check_table input.
modify itab2 index normal-current_line.
if sy-subrc ne 0.
append itab2.
endif.
endmodule. " check_table INPUT
‎2011 Feb 14 3:59 PM
Try a
LOOP AT it_articles. "no value in it_articles and still it loops
CHAIN.
FIELD it_articles-ean11 "Value is there in header it_articles-ean11
MODULE get_article ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.And in get_article you insert/modify records in the internal table. (INDEX <TABCTRL>-CURRENT_LINE.)
Regards,
Raymond
‎2011 Feb 16 5:14 PM