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

call transaction in module pool.

Former Member
0 Likes
2,348

Hello Experts,

In my issue, I have a table control where I have 2 line items and if I select the first line for a call transaction, than the line in the header of internal table only triggers but not the selected line.

Can anyone let me know what can be done in this case.

CASE SY-UCOMM.
  WHEN 'LS24'.
  ITAB-SEL = 'X'.
LOOP AT ITAB,
   SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.
   SET PARAMETER ID 'WRK' FIELD ITAB-IWERKS.
*   SET PARAMETER ID 'LGN' FIELD RL01S-LGNUM.
ENDLOOP.
    CALL TRANSACTION 'LS24'. "AND SKIP FIRST SCREEN.
ENDCASE

Thanks and Regrds,

Nikhil.

1 ACCEPTED SOLUTION
Read only

GauthamV
Active Contributor
0 Likes
1,291

Use seperate workarea.


CASE SY-UCOMM.
  WHEN 'LS24'.
  wa-SEL = 'X'.
LOOP AT ITAB into wa where sel = 'X'.
   SET PARAMETER ID 'MAT' FIELD wa-MATNR.
   SET PARAMETER ID 'WRK' FIELD wa-IWERKS.
ENDLOOP.
    CALL TRANSACTION 'LS24'. "AND SKIP FIRST SCREEN.
ENDCASE

Hello Experts,

In my issue, I have a table control where I have 2 line items and if I select the first line for a call transaction, than the line in the header of internal table only triggers but not the selected line.

Can anyone let me know what can be done in this case.

CASE SY-UCOMM.
  WHEN 'LS24'.
  ITAB-SEL = 'X'.
LOOP AT ITAB,
   SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.
   SET PARAMETER ID 'WRK' FIELD ITAB-IWERKS.
*   SET PARAMETER ID 'LGN' FIELD RL01S-LGNUM.
ENDLOOP.
    CALL TRANSACTION 'LS24'. "AND SKIP FIRST SCREEN.
ENDCASE

Thanks and Regrds,

Nikhil.

7 REPLIES 7
Read only

Former Member
0 Likes
1,291

Hi,

Have u added the w/selcolm with name 'ITAB_SEL' in the properties of table control, if not add tat then it will work with the following code

CASE SY-UCOMM.

WHEN 'LS24'.

LOOP AT ITAB where sel = 'X',

SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.

SET PARAMETER ID 'WRK' FIELD ITAB-IWERKS.

  • SET PARAMETER ID 'LGN' FIELD RL01S-LGNUM.

ENDLOOP.

CALL TRANSACTION 'LS24'. "AND SKIP FIRST SCREEN.

ENDCASE

Read only

GauthamV
Active Contributor
0 Likes
1,292

Use seperate workarea.


CASE SY-UCOMM.
  WHEN 'LS24'.
  wa-SEL = 'X'.
LOOP AT ITAB into wa where sel = 'X'.
   SET PARAMETER ID 'MAT' FIELD wa-MATNR.
   SET PARAMETER ID 'WRK' FIELD wa-IWERKS.
ENDLOOP.
    CALL TRANSACTION 'LS24'. "AND SKIP FIRST SCREEN.
ENDCASE

Read only

Former Member
0 Likes
1,291

H Gautam,

I am not using work area in this report if I need to use work area than i need to completely modify the table control.

Is there any other way I can use such a logic.

Thnks,

Nikhil.

Read only

Former Member
0 Likes
1,291

Hi nikhil,

just do this in the flow logic Have u added the w/selcolm with name 'ITAB-SEL' in the properties of table control, if not add tat then it will work with the following code

added sel field in the internal table & do the above step it will work there is not much change required

CASE SY-UCOMM.

WHEN 'LS24'.

LOOP AT ITAB where sel = 'X',

SET PARAMETER ID 'MAT' FIELD ITAB-MATNR.

SET PARAMETER ID 'WRK' FIELD ITAB-IWERKS.

  • SET PARAMETER ID 'LGN' FIELD RL01S-LGNUM.

ENDLOOP.

CALL TRANSACTION 'LS24'. "AND SKIP FIRST SCREEN.

ENDCASE

Read only

Former Member
0 Likes
1,291

Hi,

Yes I have done that. Still issue not solved.

This will trigger if I have only 1 item level but incase I have more than one it takes the only header entry from internal table.

Thanks,

Nikhil.

Read only

Former Member
0 Likes
1,291

Hi

ITAB-SEL = 'X'. " Just Check in Debug wether this condition is getting satisfied or not
"Then only The TCode is called in your Posted COde

Check the below thread

in PAI
loop at itab.
module get_cursor.
endloop.

 module get_cursor.
get cursor field fnam value fval line tab_line. " Declare these varaibles in TOP Include
endmodule
CASE SY-UCOMM.
  WHEN 'LS24'.
  wa-SEL = 'X'.
read table ITAB with key sel = 'X'.  "or
read table itab index tab_line. " As obtained in the GET_CURSOR module

if sy-subrc = 0.
   SET PARAMETER ID 'MAT' FIELD itab-MATNR.
   SET PARAMETER ID 'WRK' FIELD itab-IWERKS.
   SET PARAMETER ID 'LGN' FIELD itab-lgnum.
CALL TRANSACTION 'LS24'. "AND SKIP FIRST SCREEN.
endif.
"Note: Since LS24 takes only single inputs you dont need to loop itab simple READ table is enough.
"As suggested by MADHU use Row selector on Table control otherwise use GET CURSOR method
    ENDCASE

Cheerz

Ram

Read only

Former Member
0 Likes
1,291

Hi Ram,

Thanks for your assistance issue solved. You rock.

Thanks again,

Nikhil