Application Development 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: 

PUSH BUTTON IN TABLE CONTROL WITH PARAMTER ID

Former Member
0 Kudos
300

HI EXPERTS…

AM NEW TO SAP, AND HAVE A PROBLEM IN PROGRAM,HAVE SEARCHED FOR THIS BUT COULDN’T GET SOLUTION.

AM HAVING A PUSH BUTTON IN TABLE CONTROL,NOW WHENEVER I CLICK THE PUSH BUTTON,
AM CALLING A TRANSACTION CARRYING PARAMETER ID ,THE FIELD VALUE FOR PARAMETER ID SELECTED FROM THE TABLE CONTROL.


NUMBER

PUSHBUTTON

1000

PUSH

1001

PUSH


WHEN I PRESS THE 1ST PUSH BUTTON IT SHOULD GET PARAMETER ID VALUE AS 1000,
WHEN I PRESS THE 2ND PUSH BUTTON IT SHOULD GET PARAMETER ID VALUE AS 1001.

WHEN ‘PUSH’.

      SET PARAMETER  ID 'ZREQ' FIELD NUMBER. (ZREQ IS PARAMTER ID)

      CALL TRANSACTION 'MY TRANSACTION'.

THANKING YOU.

Moderator message: please do not post in all capitals.

Message was edited by: Thomas Zloch

1 ACCEPTED SOLUTION

Former Member
0 Kudos
152

try getting row number using get cursor and read the table with index row number.

14 REPLIES 14

Former Member
0 Kudos
153

try getting row number using get cursor and read the table with index row number.

0 Kudos
152

Thankyou for your reply Aswatha,
Could u please tel me a little more about your reply??
and,in my table control am having w / selcolumn.is there something i can do with it??
thankyou..

0 Kudos
152

In pbo set the cursor for the field button using SET CURSOR FIELD fieldname.

In pai once you clicked on that button use GET CURSOR FIELD fieldname LINE line.

now read the table with index line.

0 Kudos
152

OK,THANKS..
I SHALL TRY IT.

0 Kudos
152

I Checked it out..i checked out the value for line in debugger,
its always '0'.

0 Kudos
152

How did you define the push button, it should work fine with default settings (check via SE51 that function type is initial)

* In Dynpro PAI

PROCESS AFTER INPUT.

  LOOP AT ITAB.

    CHAIN.

      FIELD XXX... " etc.

    ENDCHAIN.

  ENDLOOP.

* etc.

    ENDCHAIN.

  MODULE user_command.

* In main program

MODULE user_command_0100 INPUT.

  CASE OK_CODE.

     WHEN 'PUSH'.

       GET CURSOR LINE line.

* etc.

ENDMODULE.    

Regards,

Raymond

0 Kudos
152

Hey sorry for the late reply and As Raymond already mentioned use GET CURSOR LINE line.

Use this line as index to read the internal table.

0 Kudos
152

Thanks a lot for your reply Guru's....

i have declared line as type i.
is it ok???

0 Kudos
152

ya not a problem... in fact it should be type i only as it is a number.  cheers...

0 Kudos
152

No problem, in a get cursor statement field name must be a character type and line an integer (just press F1 on GET statement)

Regards,

Raymond

0 Kudos
152

thanks a lot for your reply..but,still am getting '0' in line,

could you please help me??

0 Kudos
152

should i put the GET statement inside loop???
am using internal table for populating data in table control.

0 Kudos
152

Thanks a lot!!!!
it finally worked...i got values for line...
now trying to read table with index.replying would be really helpful.
thanks a lot..

0 Kudos
152

Hi Askar,

good to hear u got the result ......please close the thread.

thanks.