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: 

dialog programing

Former Member
0 Kudos

Hi

In dialog programming if i enter the vendor code and press enter then it should automatically display the vendor name. how to do this.

Thanks,

Madhu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi madhu

in PBO of the screen write the code

case sy-ucom.

when 'fetch'

select <vendor name> from zatble into <field of type vendor name> where vendor code = <screen field name>

now u can display this in the screen in the text box having name same as <field of type vendor name>

hope it clears ur doubt

regards

ravish

<b>plz dont forget to reward points if useful</b>

5 REPLIES 5

Former Member
0 Kudos

Hi madhu,

Here i given the dialog programming for displaying material information

In first screen i took Material__________________

after entering material no. over there

go for display push button

where it will display data's of

Material type_________

Industry sector__________

Base unit ___________

to check this one just copy this codings into ur program

and dont forget to create transaction to execute this dialog program.

Like this Dialog Program u go for vendor name to display..

&----


*& Module pool ZDIALOG_TEST

*&

&----


*&

*&

&----


PROGRAM ZDIALOG_TEST.

TABLES : MARA.

DATA : OK_CODE LIKE SY-UCOMM.

DATA : OK_CODE_2000 LIKE SY-UCOMM.

DATA : MATNR LIKE MARA-MATNR,

MTART LIKE MARA-MTART,

MEINS LIKE MARA-MEINS,

MBRSH LIKE MARA-MBRSH.

&----


*& Module STATUS_1000 OUTPUT

&----


  • text

----


module STATUS_1000 output.

SET PF-STATUS 'PF_1000'.

SET TITLEBAR 'TITLE_1000'.

endmodule. " STATUS_1000 OUTPUT

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


module USER_COMMAND_1000 input.

IF MARA-MATNR NE ''.

IF OK_CODE = 'DISPLAY'.

SELECT SINGLE MATNR MTART MEINS MBRSH FROM MARA

INTO (MATNR,MTART,MEINS,MBRSH) WHERE

MATNR = MARA-MATNR.

IF SY-SUBRC EQ 0.

MARA-MATNR = MATNR.

MARA-MTART = MTART.

MARA-MEINS = MEINS.

MARA-MBRSH = MBRSH.

CALL SCREEN 2000.

ENDIF.

ENDIF.

ENDIF.

CASE OK_CODE.

WHEN 'BACK'.

LEAVE PROGRAM.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'CANCEL'.

LEAVE PROGRAM.

ENDCASE.

endmodule. " USER_COMMAND_1000 INPUT

&----


*& Module STATUS_2000 OUTPUT

&----


  • text

----


module STATUS_2000 output.

SET PF-STATUS 'PF_2000'.

SET TITLEBAR 'TITLE_2000'.

endmodule. " STATUS_2000 OUTPUT

&----


*& Module USER_COMMAND_2000 INPUT

&----


  • text

----


module USER_COMMAND_2000 input.

CASE OK_CODE_2000.

WHEN 'BACK'.

LEAVE TO SCREEN 1000.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'CANCEL'.

LEAVE PROGRAM.

ENDCASE.

endmodule. " USER_COMMAND_2000 INPUT

Reward points if this is useful to u,

Best Wishes

Regards

Guna.,

Former Member
0 Kudos

hi,

press enter will trigger another dialog step, that is a pai-pbo step.

so in the following pai you can use set a flag about needing to fill the vendor name,

and in the pbo you fill the name according number.

code format.

module in PAI:

save_ok = ok_code.

case save_ok.

when empty.

flag = XX " means you need to fill vendor name

module in PBO.

if flag = XX

fill name according to number.

hope that'll solve your problem.

and another solution is to develop your own search help and assign it to your field.

regards.

Former Member
0 Kudos

example code

when `display`.

submit report.

or

when `display`.

set parameter id

call transcation me21n.

Former Member
0 Kudos

hi madhu

in PBO of the screen write the code

case sy-ucom.

when 'fetch'

select <vendor name> from zatble into <field of type vendor name> where vendor code = <screen field name>

now u can display this in the screen in the text box having name same as <field of type vendor name>

hope it clears ur doubt

regards

ravish

<b>plz dont forget to reward points if useful</b>

Former Member
0 Kudos

Hi,

goto tcode ABAPDOCU

and select ABAP User Dialogs ->Screens ->Processing Screens ->Screen Fields with Dictionary Reference

it will be exactly similar to ur requirement.

check it.

<b>reward if helpful</b>

rgds,

bharat.