Posts

Showing posts from October, 2024

CDS Views: Session variable and Data Manipulation

Session variable: The variables which are assigned at runtime. LTRIM() : Used to remove the 0's before manterial number. @AbapCatalog.sqlViewName: 'ZVB_CDS_SESSION' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Session variable' define view ZAB_SESSION_VAR as select from ekpo { ebeln , ebelp , aedat , ltrim ( matnr , '0' ) as mat_no ,   case when statu = 'V' then 'Created via SO' end as status ,   case bukrs when '0003' then 'Template for cmp' end as compnay_code   netpr as net_price , ( netpr - 10 ) as price   }where bukrs = '0003' and aedat < $session.system_date

CDS View with Input Parameters and calling it throgh SE38

CDS View with Prameters: @AbapCatalog.sqlViewName: 'ZV_CDS_IP_PARAM' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'View with parameters' define view ZAB_CDS_WITH_PARAMETERS with parameters P_MTART : mtart , P_MATKL : matkl as select from mara { key matnr as MATERIAL , mtart as MAT_TYPE , matkl as MAT_GROUP } where mtart = : P_MTART and matkl = : P_MATKL     Calling CDS View through SE38:   Program: REPORT  zvb_test .   PARAMETERS : p_mtype   TYPE  mtart ,            p_mgroup  TYPE  matkl . SELECT   *    FROM  zab_cds_with_parameters (  p_mtart  =  @p_mtype ,  p_matkl  =  @p_mgroup  )    INTO  TABLE  @DATA ( lt_data ) .     Calling CD...

Drop Down list on Selection Screen

Image
*&---------------------------------------------------------------------* *& Report ZVB_SEL_LISTBOX *&---------------------------------------------------------------------* REPORT  zvb_sel_listbox . TYPE-POOLS :  vrm . DATA :  name      TYPE  vrm_id ,       it_list  TYPE  vrm_values ,       iw_value  LIKE  LINE  OF  it_list . PARAMETERS :  p_alph  AS  LISTBOX VISIBLE LENGTH  15 . AT  SELECTION-SCREEN  OUTPUT .   name  =  'P_ALPH' .   iw_value - key  =  'A' .   iw_value - text  =  'Apple' .    APPEND  iw_value TO  it_list .   iw_value - key  =  'B' .   iw_value - text  =  'Bat' .    APPEND  iw_value TO  it_list . * Call the...

Splitting Shipments based on Conditions

VT04: If Shipment document is created by Background Job (VT04) with Delivery document of Return Purchase order, skip all the validations. Follow one Return PO to one Shipment and splitting the shipments based on currency (WAERK), sales org (VKORG), Delivery date (LFDAT), Route (ROUTE), Bill-to (BP)-KUNNR, Ship to (SH)-KUNNR. 1.GO to T-code ‘SMOD’. 2.Click on search help then Information system. 3.Enter the package of program ‘SAPMV56A’ (Prog of VT04). 4.click on continue. 5.The Enhancement ‘V56MVT04’ and function module exit ‘EXIT_SAPLV56M_002’ is used for splitting shipments. Implementing Function Module Exit. 1.Go to T-code ‘CMOD’. 2.Create the project. 3.click on enhancement assignments and enter the Enhancement name ‘V56MVT04’. 4.Click on ‘Components’. 5.Double click on function module exit ‘EXIT_SAPLV56M_002’ and double click on Include ‘ZXV56U27’ and write the logic to update the C_VTTP according to the requirement to split the shipments. Sort C_VTTP by tk...