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

Table control problem

Karan_Chopra_
Active Participant
0 Likes
1,034

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

10 REPLIES 10
Read only

Former Member
0 Likes
996

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

Read only

kanwardeepsingh_gill
Product and Topic Expert
Product and Topic Expert
0 Likes
996

Are you using the work area or internal table field in PAI?

Read only

0 Likes
996

Do as said by Menegazzo Marco , it should solve ur problem

Read only

Karan_Chopra_
Active Participant
0 Likes
996

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

Read only

0 Likes
996

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

Read only

0 Likes
996

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
996

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.

Read only

Karan_Chopra_
Active Participant
0 Likes
996

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

Read only

0 Likes
996

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.

Read only

0 Likes
996

If ur question is answered, please close this thread and mark as answered