‎2007 May 01 2:45 PM
hi gurus..,
i need to display vendors and customers details by using radio buttons.in the selection scereen if i select vendors customer should be disable and i need to get the information of vendors,vice versa.
otherwise give me some examples that how can i use radia buttons in my report program with complete code.if useful full points urgent.
thanks
yogi
‎2007 May 01 2:50 PM
parameters: vend RADIOBUTTON GROUP r1 ,
cust RADIOBUTTON GROUP r1 .
start of selection.
if vend = 'X'.
select vendors...
elseif cust = 'X'.
select customers..
endif...
‎2007 May 01 5:21 PM
hi augastine,
pls give me entire code so that i can understand easily.
thanx
yogi
‎2007 May 01 2:54 PM
Hi,
Look at the DEMO programs
DEMO_AT_SELECTION_ON_BLOCK
DEMO_AT_SELECTION_ON_END
DEMO_AT_SELECTION_ON_RADIO
Regards
Sudheer
‎2007 May 01 5:24 PM
Below code used for defining code on selection screen. You can take reference.
SELECTION SCREEN
SELECT-OPTIONS : S_MATNR FOR MARA-MATNR MODIF ID sc1.
PARAMETER : DEL AS CHECKBOX MODIF ID sc1.
SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN MODIF ID sc2.
PARAMETERS : S_FILE LIKE RLGRAP-FILENAME MODIF ID sc2.
SELECTION-SCREEN: FUNCTION KEY 1,
FUNCTION KEY 2.
DISPLAY THE SELETION DEPENDING UPON THE USE SELECTION
INITIALIZATION.
sscrfields-functxt_01 = 'Material'.
sscrfields-functxt_02 = 'Purchase document'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'SC1' OR SCREEN-GROUP1 = 'SC2'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN .
CASE SSCRFIELDS-UCOMM.
WHEN 'FC01'.
V_FLAG = '1'.
V_FLAG1 = '0'.
WHEN 'FC02'.
V_FLAG = '0'.
V_FLAG1 = '1'.
ENDCASE.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'SC1'.
SCREEN-ACTIVE = V_FLAG.
MODIFY SCREEN.
CLEAR SCREEN.
ELSEIF SCREEN-GROUP1 = 'SC2'.
SCREEN-ACTIVE = V_FLAG1.
MODIFY SCREEN.
CLEAR SCREEN.
ENDIF.
ENDLOOP.
‎2007 May 01 5:25 PM
Yogi, if you are using radio buttons in the selection screen and if you select one the others become disable,
However you need to handel it in ur code.
PARAMETERS : manual RADIOBUTTON GROUP rad2 DEFAULT 'X',
delete RADIOBUTTON GROUP rad2,
batch RADIOBUTTON GROUP rad2.
IF manual = 'X'.
*Write the code for the action to be performed when first radion button is selected
ELSEIF delete = 'X'.
*Similarly for secon radio button
ELSEIF batch = 'X'.
An finally for the third.
ENDIF.
Hope this helps.
Shreekant
‎2007 May 01 5:29 PM
hi shreekant,
give me the entir code wth an example so tht i can understand easily.plss
thanx
yogi
‎2007 May 01 5:37 PM
REPORT demo_at_selection_on_radio .
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: r1 RADIOBUTTON GROUP rad1 DEFAULT 'X',
r2 RADIOBUTTON GROUP rad1,
r3 RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: r4 RADIOBUTTON GROUP rad2 DEFAULT 'X',
r5 RADIOBUTTON GROUP rad2,
r6 RADIOBUTTON GROUP rad2.
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP rad1.
IF r1 = 'X'.
MESSAGE w888(sabapdocu) WITH text-001.
ENDIF.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP rad2.
IF r4 = 'X'.
MESSAGE w888(sabapdocu) WITH text-001.
ENDIF.
Hope this helps.
Shreekant
‎2007 May 01 5:43 PM
hi shree,
this is my exact requirement.
i need to display vendors and customers details by using radio buttons.in the selection scereen if i select vendors customer should be disable and i need to get the information of vendors,vice versa.
how can i use radia buttons in my report program with complete code.if useful full points urgent.
0 i need to display vno vname
0 i need to display cno cname
thanks
yogi
‎2007 May 01 5:52 PM
Hi Yogi,
Inorder to have this functionality of displaying Vendors or Customers based on the User selection at the selection screen, we need to use the Events.
The Event that we use here is AT SELECTION-SCREEN OUTPUT.
Below is the complete code , just copy , paste & execute you will know how it works.
The below code , at the selection screen on choosing first Radio Button it will display Sales Docu & Creation Date fields & on choosing second radio button it will display Material & Creation date fields hiding the other 2 fields.
REPORT ZSEL_SCRN_OUTPUT.
TABLES: MARA, VBAK, KNA1.
DATA IT_VBAK LIKE VBAK OCCURS 0 WITH HEADER LINE.
DATA IT_VBAP LIKE VBAP OCCURS 0 WITH HEADER LINE.
PARAMETERS: P_SAL RADIOBUTTON GROUP grp ,
P_MAT RADIOBUTTON GROUP grp.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN,
S_ERDAT FOR VBAK-ERDAT.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,
S_ERSDA FOR MARA-ERSDA.
INITIALIZATION.
P_SAL = 'X'.
AT SELECTION-SCREEN OUTPUT.
IF P_SAL EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP4 EQ '004'
OR SCREEN-GROUP4 EQ '005'.
SCREEN-INVISIBLE = 1.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF P_MAT EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP4 EQ '002'
OR SCREEN-GROUP4 EQ '003'.
SCREEN-INVISIBLE = 1.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
SELECT * FROM VBAK INTO TABLE IT_VBAK WHERE VBELN IN S_VBELN.
END-OF-SELECTION.
LOOP AT IT_VBAK.
WRITE:/ IT_VBAK-VBELN,
IT_VBAK-ERDAT, IT_VBAK-ERNAM,
IT_VBAK-KUNNR.
HIDE IT_VBAK-VBELN.
ENDLOOP.
Hope this will be useful.
Thanks,
Daniel