2006 Aug 08 2:32 AM
Hi, few doubts abt Dialog Programming
i create a screen say 0100 whihc contains some fields. and i create 3 tcodes using the same screen, 1st for create email grp, 2nd for change of eml grp, 3rd for display of eml grp.
the title shud change for every tcode.
the 1st and 2nd shud not be grayed out.
all fields shud be grayed out in display except one.
do i now need to write 3 progs or can i handle all this in a sinle prog.
if it is a single progrm how do i do that all 3 modes in a single prog?
Plz help
Gopi
2006 Aug 08 2:41 AM
Hi,
For Displaying different Title`s as per the TCODE :
If sy-tcode = `ZTRANS1`.
set TITLEBAR `TITLE1`.
elseif sy-tcode = `ZTRANS2`.
set TITLEBAR `TITLE2`.
elseif sy-tcode = `ZTRANS3`.
SET TITLEBAR `TITLE3`.
endif.
For Making Fields editable non-editable as per tcode *
IF SY-TCODE = `ZTRANS1`.
LOOP AT SCREEN.
IF SCREEN-NAME = `FIELD1`.
SCREEN-INPUT = 0.
endif.
modify screen.
endloop.
elseif sy-tcode = `ZTRANS2`.
LOOP AT SCREEN.
IF SCREEN-NAME = `FIELD2`.
SCREEN-INPUT = 0.
endif.
modify screen.
endloop.
endif.
Best regards,
Prashant
PS : Please reward all helpful answers
2006 Aug 08 2:41 AM
Hi,
For Displaying different Title`s as per the TCODE :
If sy-tcode = `ZTRANS1`.
set TITLEBAR `TITLE1`.
elseif sy-tcode = `ZTRANS2`.
set TITLEBAR `TITLE2`.
elseif sy-tcode = `ZTRANS3`.
SET TITLEBAR `TITLE3`.
endif.
For Making Fields editable non-editable as per tcode *
IF SY-TCODE = `ZTRANS1`.
LOOP AT SCREEN.
IF SCREEN-NAME = `FIELD1`.
SCREEN-INPUT = 0.
endif.
modify screen.
endloop.
elseif sy-tcode = `ZTRANS2`.
LOOP AT SCREEN.
IF SCREEN-NAME = `FIELD2`.
SCREEN-INPUT = 0.
endif.
modify screen.
endloop.
endif.
Best regards,
Prashant
PS : Please reward all helpful answers
2006 Aug 08 3:02 AM
hi i create a eml grp in 1st tcode, in this screen i need drop down values for a field. the values are RFQ , PO. So how do i do this.
and the comp code is mandtory. so how do i validate it in case i give wrong entry other than in T001 table
Thnx in advance.
gopi
2006 Aug 08 3:06 AM
1. You can make a field as drop down using the attributes of the field on the screen. Then you can fill the list using VRM_SET_VALUES.
2. Validations are done in the PBO of the screen, you can write a separate module for validating the field where you can check if the value entered in the field is in the table T001.
Regards,
Ravi
2006 Aug 08 2:44 AM
the SAP standard way is to write 1 program to cater for all three functions.
Your program can test sy-tcode and decide what to hide/protect which title to show etc. Or you can test the tcode at startup amd assign a mode variable there based on this(1=create, 2 =change, 3 =display) and then subsequently test the mode variable.
2006 Aug 08 3:06 AM
Hi,
Pass the field name in p_l_name
and pass values 11, 10 ,45 etc in it_list - table.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = p_l_name
values = it_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Best regards,
Prashant