‎2010 Apr 09 9:35 AM
I have a table control and if i use internal table for that using occurs 0 it wrks fine
but if i use work area as occur 0 is obsolete it gives error "Invaid field" when i go in PAI
I did all the modifications to code accordingly
‎2010 Apr 09 9:44 AM
Hi koran....
if you need a work area you must use a structure...no an internal table
data : lt_tab type tab occurs 0,
ls_str type tab.
loop at lt_tab into ls_str.
endloof.
regards
Marco
‎2010 Apr 09 9:46 AM
‎2010 Apr 09 9:48 AM
‎2010 Apr 09 9:56 AM
I used this way
TYPES : BEGIN OF gs_pmpb_bid_struc,
sel TYPE char1,
batchid TYPE zzbatch_id,
pmpb TYPE zzzpmpb,
END OF gs_pmpb_bid_struc,
DATA : gi_pmpb_bchid TYPE STANDARD TABLE OF gs_pmpb_bid_struc,
gs_pmpb_bchid LIKE LINE OF gi_pmpb_bchid.
gi_pmpb_bchid is corresponding to table control.
this is my screen
PROCESS BEFORE OUTPUT.
MODULE status_9911.
Set initial table values display
LOOP AT gi_pmpb_bchid INTO gs_pmpb_bchid
WITH CONTROL tc_9911 CURSOR tc_9911-current_line.
MODULE set_table_rows.
ENDLOOP.
PROCESS AFTER INPUT.
Initialize check list
MODULE init_bid_list.
LOOP AT gi_pmpb_bchid.
Modify PMPB Input
FIELD gi_pmpb_bchid-pmpb MODULE check_pmpb. -
>Error
Modify BatchID Input
FIELD gi_pmpb_bchid-batchid MODULE check_batchid.
ENDLOOP.
It is giving error while going to PAI module
MODULE check_pmpb INPUT.
MODIFY gi_pmpb_bchid FROM gs_pmpb_bchid INDEX tc_9911-current_line. ---> Error
ENDMODULE. " CHECK INPUT
mentioned after loop above
‎2010 Apr 09 10:01 AM
Declare ur table control using the work area and not the internal table.
And replace
Modify BatchID Input
FIELD gi_pmpb_bchid-batchid MODULE check_batchid. -> wa_pmpb_bchid-batchid MODULE check_batchid.
Edited by: Kanwardeep Singh Gill on Apr 9, 2010 11:04 AM
‎2010 Apr 09 10:02 AM
Hi
change your code as follow
DATA : gi_pmpb_bchid TYPE TABLE OF gs_pmpb_bid_struc,---->delete standart but only TYPE TABLE OF
gs_pmpb_bchid TYPE gs_pmpb_bid_struc.---->use only type
LOOP AT gi_pmpb_bchid into gs_pmpb_bchid.-------> you must use into
* Modify PMPB Input
* Modify BatchID Input
FIELD gi_pmpb_bchid-batchid MODULE check_batchid.
ENDLOOP.
regards
‎2010 Apr 09 10:11 AM
Check this
data:it type standard table of mara.
data:wa type mara.
controls:tb_ctrl type tableview using screen 100.
Name each field of table control with 'wa'.
in PBO
loop with control tb_ctrl.
module fill_tab.
endloop.
in PAI.
loop at it into wa.
module modify.
endloop.
module fill_tab.
read table it into wa index tb_ctrl-current_line.
endmodule.
module modify.
modify it from wa index tb_ctrl-current_line.
endmodule.
‎2010 Apr 09 10:28 AM
LOOP AT gi_pmpb_bchid into gs_pmpb_bchid cannot be used
it says only LOOP AT gi_pmpb_bchid can be used no into
‎2010 Apr 09 10:35 AM
Hi Karan,
In PAI, there is no need to use the into clause.just loop on the internal table and dats it.
But when you refer to the fields in the PAI and PBO, use work area.
Code for ur reference:
PROCESS BEFORE OUTPUT.
MODULE IT_CONTRO_CHANGE_TC_ATTR.
LOOP AT IT_VBAK
INTO WA_VBAK
WITH CONTROL IT_CONTRO
CURSOR IT_CONTRO-CURRENT_LINE.
MODULE IT_CONTRO_GET_LINES.
ENDLOOP.
MODULE STATUS_0001.
PROCESS AFTER INPUT.
LOOP AT IT_VBAK.
CHAIN.
FIELD WA_VBAK-VBELN.
FIELD WA_VBAK-AUDAT.
FIELD WA_VBAK-VBTYP.
FIELD WA_VBAK-AUART.
FIELD WA_VBAK-NETWR.
FIELD WA_VBAK-WAERK.
FIELD WA_VBAK-VKORG.
FIELD WA_VBAK-VTWEG.
FIELD WA_VBAK-SPART.
FIELD WA_VBAK-KNUMV.
FIELD WA_VBAK-KALSM.
FIELD WA_VBAK-KUNNR.
endchain.
ENDLOOP.
MODULE USER_COMMAND_0001.
‎2010 Apr 09 11:21 AM
If ur question is answered, please close this thread and mark as answered