Upload
aloxanh
View
17
Download
0
Embed Size (px)
DESCRIPTION
DEMO
Citation preview
Show/Hide the controls on selection screen on ABAP*&---------------------------------------------------------------------**&ReportYSELECTION_SCREEN_SHOWHIDE*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------***=====SelectionTextonscreen====================**===========TextSymbol==========================*002=Displaytype*003=ViewbyBillingorSO**=====SelectionText=============================*P_AUART=SalesDoc.Type*P_BIL=Billing*P_CUS=Hidecustomercode*P_FKART=Billingtype*P_SO=SaleOrder*P_VKORG=SalesOrganization*P_ZDC=Discount*P_ZDC3=ZDC3-Packagediscount+VAT*P_ZDC4=ZDC4-SpecialDiscount+VAT*S_AUDAT=DocumentDate*S_BZIRK=SalesDistrict*S_FKDAT=Billingdate*S_KDGRP=Customergroup*S_KUNAG=Customernumber*S_MATNR=Materialnumber*S_VKGRP=SalesGroup*S_VTWEG=DistributionChannel
**===============================================
REPORTYSELECTION_SCREEN_SHOWHIDE.
TABLES:vbrk,konv,kna1,vbrp,vbak,vbap.DATA:g_ucommTYPEsy-ucomm.DATA:gv_kschlTYPEkonv-kschl.DATA:gv_stunrTYPEkonv-stunr.
SELECTION-SCREENBEGINOFBLOCKboptWITHFRAMETITLEtext-003.PARAMETERS:p_bilTYPEcRADIOBUTTONGROUPgoptDEFAULT'X'USER-COMMANDcopt,p_soTYPEcRADIOBUTTONGROUPgopt.SELECTION-SCREENENDOFBLOCKbopt.SELECTION-SCREENBEGINOFBLOCKblgWITHFRAMETITLEtext-001.PARAMETERS:p_vkorgTYPEvbrk-vkorg."OBLIGATORY."SalesOrganization
SELECT-OPTIONS:s_vtwegFORvbrk-vtweg,"OBLIGATORY,"DistributionChannels_fkdatFORvbrk-fkdat."OBLIGATORY."Billingdate
PARAMETERS:p_fkartTYPEvbrk-fkartDEFAULT'ZF2'."Billingtype
*forSOSELECT-OPTIONS:s_audatFORvbak-audat."DocumentDatePARAMETERSp_auartTYPEvbak-auartDEFAULT'ZOR'."OBLIGATORY
SELECT-OPTIONS:s_kunagFORvbrk-kunag,"Customernumbers_kdgrpFORvbrk-kdgrp,"Customergroups_vkgrpFORvbrp-vkgrp,"SalesGroups_bzirkFORvbrk-bzirk,"SalesDistricts_matnrFORvbrp-matnr."MaterialnumberSELECTION-SCREENENDOFBLOCKblg.
SELECTION-SCREENBEGINOFBLOCKblgoptWITHFRAMETITLEtext-002.PARAMETERS:p_cusTYPEcASCHECKBOX.PARAMETERS:p_zdcTYPEcASCHECKBOXUSER-COMMANDsh.PARAMETERS:p_zdc3TYPEcRADIOBUTTONGROUPgr1.PARAMETERS:p_zdc4TYPEcRADIOBUTTONGROUPgr1.
SELECTION-SCREENENDOFBLOCKblgopt.
ATSELECTION-SCREEN.g_ucomm=sy-ucomm.CHECKsy-ucommNE'COPT'.IFp_vkorgISINITIAL.MESSAGE'SalesOrganizationismandatory'TYPE'E'.ENDIF.IFs_vtwegISINITIAL.MESSAGE'DistributionChannelismandatory'TYPE'E'.ENDIF.IFs_fkdatISINITIALANDp_bilEQ'X'.MESSAGE'Billingdateismandatory'TYPE'E'.ENDIF.IFs_audatISINITIALANDp_soEQ'X'.MESSAGE'Documentdateismandatory'TYPE'E'.ENDIF.IFp_fkartISINITIALANDp_bilEQ'X'.MESSAGE'Billingtypeismandatory'TYPE'E'.ENDIF.IFp_auartISINITIALANDp_soEQ'X'.MESSAGE'Salesdocumenttypeismandatory'TYPE'E'.ENDIF.
ATSELECTION-SCREENOUTPUT.
IFp_bil='X'.LOOPATSCREEN.IFscreen-nameCS'S_FKDAT'ORscreen-nameCS'P_FKART'.screen-active=1.MODIFYSCREEN.ENDIF.IFscreen-nameCS'S_AUDAT'ORscreen-nameCS'P_AUART'.screen-active=0.MODIFYSCREEN.ENDIF.ENDLOOP.ELSE.LOOPATSCREEN.IFscreen-nameCS'S_FKDAT'ORscreen-nameCS'P_FKART'.screen-active=0.MODIFYSCREEN.ENDIF.IFscreen-nameCS'S_AUDAT'ORscreen-nameCS'P_AUART'.screen-active=1.MODIFYSCREEN.ENDIF.ENDLOOP.ENDIF.
IFp_zdc='X'.LOOPATSCREEN.IFscreen-nameCS'P_ZDC3'ORscreen-nameCS'P_ZDC4'.screen-active=1.MODIFYSCREEN.ENDIF.ENDLOOP.ELSE.LOOPATSCREEN.IFscreen-nameCS'P_ZDC3'ORscreen-nameCS'P_ZDC4'.screen-active=0.MODIFYSCREEN.ENDIF.ENDLOOP.ENDIF.
CASEg_ucomm.WHEN'SH'."Show/HideDiscountIFp_zdc='X'.LOOPATSCREEN.IFscreen-nameCS'P_ZDC3'ORscreen-nameCS'P_ZDC4'.screen-active=1.MODIFYSCREEN.ENDIF.ENDLOOP.ELSE.LOOPATSCREEN.IFscreen-nameCS'P_ZDC3'ORscreen-nameCS'P_ZDC4'.screen-active=0.MODIFYSCREEN.ENDIF.ENDLOOP.ENDIF.
WHEN'COPT'."forChooseBillingorSaleOrder
IFp_bil='X'.LOOPATSCREEN.IFscreen-nameCS'S_FKDAT'ORscreen-nameCS'P_FKART'.screen-active=1.MODIFYSCREEN.ENDIF.IFscreen-nameCS'S_AUDAT'ORscreen-nameCS'P_AUART'.screen-active=0.MODIFYSCREEN.ENDIF.ENDLOOP.ELSE.LOOPATSCREEN.IFscreen-nameCS'S_FKDAT'ORscreen-nameCS'P_FKART'.screen-active=0.MODIFYSCREEN.ENDIF.IFscreen-nameCS'S_AUDAT'ORscreen-nameCS'P_AUART'.screen-active=1.MODIFYSCREEN.ENDIF.ENDLOOP.ENDIF.ENDCASE.
Figure 1
Figure 2
Figure 3