Select single records behalf of condition
some time we get this type requirement to select single records behalf of condition so this code help to to write logic to select single records behalf of
condition below code help to to show fetch URL TO database and display in export parameter
FUNCTION zbanner_fm.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" EXPORTING
*" VALUE(EX_BANNER_1_1) TYPE /SAPSMOSS/URL
*" VALUE(EX_BANNER_1_2) TYPE /SAPSMOSS/URL
*" VALUE(EX_BANNER_1_3) TYPE /SAPSMOSS/URL
*" VALUE(EX_BANNER_2_0) TYPE /SAPSMOSS/URL
*"----------------------------------------------------------------------
DATA : gt_zbanner_home TYPE STANDARD TABLE OF zbanner_home,
gs_zbanner_home TYPE zbanner_home,
lv_max TYPE i.
* change by Rohini kumar date 4/08/2018
SELECT MAX( seq_no ) FROM zbanner_home INTO gs_zbanner_home.
lv_max = gs_zbanner_home-seq_no.
CLEAR : gs_zbanner_home.
SELECT SINGLE seq_no banner_1_1 banner_1_2 banner_1_3 banner_2_0
FROM zbanner_home
INTO ( gs_zbanner_home-seq_no, gs_zbanner_home-banner_1_1,gs_zbanner_home-banner_1_2,gs_zbanner_home-banner_1_3,gs_zbanner_home-banner_2_0 )
WHERE seq_no = lv_max .
IF sy-subrc IS INITIAL.
ex_banner_1_1 = gs_zbanner_home-banner_1_1.
ex_banner_1_2 = gs_zbanner_home-banner_1_2.
ex_banner_1_3 = gs_zbanner_home-banner_1_3.
ex_banner_2_0 = gs_zbanner_home-banner_2_0.
ENDIF.
**************************** End of change *********************************************
ENDFUNCTION.
*********************************************************************************RICEF
Reports interface Converstion , Enhancements , Forms
Classical Reports ALV Programming, ALE/ IDOC
BDA Programming, Call Transcation , SAP Script, Smartforms, Adove forms,
SAP T-CODE
MM FLOW , SD FLOW , SE11,SE18 ,SE24,SE30, SM12,ST22, SE41, SE51, SE80,SE84
SE90,SE10,SE09,SE03,
Getway T-Code
/IWFND/GW_CLIENT
/IWFND/ERROR_LOG
/IWFND/APPS_LOG
/IWBEP/VIEW_LOG
/IWFND/CACHE_CLEANUP
/IWFND/TRACES
*********************************************************************************
condition below code help to to show fetch URL TO database and display in export parameter
FUNCTION zbanner_fm.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" EXPORTING
*" VALUE(EX_BANNER_1_1) TYPE /SAPSMOSS/URL
*" VALUE(EX_BANNER_1_2) TYPE /SAPSMOSS/URL
*" VALUE(EX_BANNER_1_3) TYPE /SAPSMOSS/URL
*" VALUE(EX_BANNER_2_0) TYPE /SAPSMOSS/URL
*"----------------------------------------------------------------------
DATA : gt_zbanner_home TYPE STANDARD TABLE OF zbanner_home,
gs_zbanner_home TYPE zbanner_home,
lv_max TYPE i.
* change by Rohini kumar date 4/08/2018
SELECT MAX( seq_no ) FROM zbanner_home INTO gs_zbanner_home.
lv_max = gs_zbanner_home-seq_no.
CLEAR : gs_zbanner_home.
SELECT SINGLE seq_no banner_1_1 banner_1_2 banner_1_3 banner_2_0
FROM zbanner_home
INTO ( gs_zbanner_home-seq_no, gs_zbanner_home-banner_1_1,gs_zbanner_home-banner_1_2,gs_zbanner_home-banner_1_3,gs_zbanner_home-banner_2_0 )
WHERE seq_no = lv_max .
IF sy-subrc IS INITIAL.
ex_banner_1_1 = gs_zbanner_home-banner_1_1.
ex_banner_1_2 = gs_zbanner_home-banner_1_2.
ex_banner_1_3 = gs_zbanner_home-banner_1_3.
ex_banner_2_0 = gs_zbanner_home-banner_2_0.
ENDIF.
**************************** End of change *********************************************
ENDFUNCTION.
*********************************************************************************RICEF
Reports interface Converstion , Enhancements , Forms
Classical Reports ALV Programming, ALE/ IDOC
BDA Programming, Call Transcation , SAP Script, Smartforms, Adove forms,
SAP T-CODE
MM FLOW , SD FLOW , SE11,SE18 ,SE24,SE30, SM12,ST22, SE41, SE51, SE80,SE84
SE90,SE10,SE09,SE03,
Getway T-Code
/IWFND/GW_CLIENT
/IWFND/ERROR_LOG
/IWFND/APPS_LOG
/IWBEP/VIEW_LOG
/IWFND/CACHE_CLEANUP
/IWFND/TRACES
*********************************************************************************
Comments
Post a Comment