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

select statement

Former Member
0 Likes
581

Hi,

i have created one textbox that i have directly taken from the DB table.

based on the lifnr i wants to get the details in other textboxes. How can i write the code for that?

4 REPLIES 4
Read only

Former Member
0 Likes
565

Hi,

in user command(PAI), check for ok code = 'ENTER'. then based on the enterd values fetch the other details from the database into a global variables.

In PBO, if this global variable is not intial, assign the values to respective text box.

reward point if useuful,

Regards,

Niyaz

Read only

Former Member
0 Likes
565

In pai.. write a case statement as..

case sy-ucomm,

when <button>

then fetch data using select statement with where condition as lifnr.

thats it..when user presses, say enter pai will be triggered and case statement executes,fetching the data..

reward if helpful..thanx..

Read only

0 Likes
565

Hi..

Create one button with function code.

In PAI,

CASE OK_CODE.

WHEN <Function code of button>

<Select statement with where condition on lifnr and store selected data in global variable which should be of same name as the textboxs on screen.>

ENDCASE.

Note: OK_CODE, you need to declare in TOP Include file with type SY-UCOMM or you can directly use SY-UCOMM instant of OK_CODE but use of OK_CODE is more preferable.

Read only

Former Member
0 Likes
565

Hi

First Define a Button like OK or SUBMIT in the first screen XXX1 and assign code to it ex: BUT_S1

DATA: IOF_S1(10) TYPE C,

IOF_S2(10) TYPE C.

DATA: OK_CODE TYPE SY-UCOMM.

MODULE USER_COMMAND_XXX1 INPUT

CASE OK_CODE.

WHEN 'BUT_S1'.

CALL SCREEN XXX2.

ENDCASE.

MODULE STATUS_XXX2 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

Fetch the record from the database using the IOF_S1 and place it in a work area

and assign the required field from the workarea to the IOF_S2

ENDMODULE. " STATUS_XXX2 OUTPUT

Hope this helps you

Thanks Ravi

Message was edited by:

Ravikanth Alapati