Posts

BAPI for material storage location Add

 We can add material storage location plant wise using third party app or web. BAPI names : BAPI_MATERIAL_MAINTAINDATA_RT Import parameters: HEADDATA: Material Tables: STORAGELOCATIONDATA: Material: Plant: STGE_LOC:   STORAGELOCATIONDATAX: Material: Plant: STGE_LOC:   use below code after completing steps. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.        

SAP MM Important Table

 List of essential and regular used table are given below. In our daily task we use these table to compose FS or analyze the information.  Mention tables are used to store and manage data related to various aspect of the procurement process. i. EKPO - Purchase Order Item: This table stores information about each item of a purchase order, including the material number, quantity, price, and delivery date. ii. EKKO - Purchasing Document Header: This table stores store information about the overall purchase order, including the vendor, purchasing organization, and order total. iii. MARA - General Material Data: This table store basic information about each material, such as its description, unit of measure, and weight. iv. MSEG - Document Segment: This table stores information about all material movements, including goods receipts, goods issues, and stock transfers. v. MKPF - Header material Document: This table stores information about each material document, including the...

Convert First character to Upper case in SAP ABAP

 In SAP sometime we need to convert string as first letter in capital format and then start with small letter word wise. For that case we need to use Function module. In my profession i did so many times. Give here example, hope it will help you to solve the issues. FM: 'FI_CONVERT_FIRSTCHARS_TOUPPER'     Data :  string   type  char255 ,       OUT_STR  TYPE  CHAR255 . string  =  ' SMALL CHANGE' . CALL  FUNCTION  'FI_CONVERT_FIRSTCHARS_TOUPPER'    EXPORTING     INPUT_STRING         =  'string' *   SEPARATORS          = ' -.,;:'   IMPORTING    OUTPUT_STRING        =  OUT_STR            .   Output: Small Change...

Event Handler Link Click

  TRY. lo_columns ?=ch_cols->get_column( 'MATNR' ). lo_columns->set_cell_type( if_salv_c_cell_type=>hotspot ). CATCH cx_salv_not_found. ENDTRY. DATA: lo_events TYPE REF TO cl_salv_events_table. lo_events = lo_salv->get_event( ). SET HANDLER cl_event_handler=>on_link_click FOR lo_events. *create a new local class fo event handler  CLASS cl_event_handler DEFINITION. PUBLIC SECTION. CLASS-METHODS on_link_click FOR EVENT link_click OF cl_salv_events_table IMPORTING row column. ENDCLASS. CLASS cl_event_handler IMPLEMENTATION. METHOD on_link_click. READ TABLE t_data INTO data(ls_data) INDEX row. CHECK sy-subrc = 0. CASE column. WHEN 'MATNR'. SET PARAMETER ID 'MAT' FIELD ls_data-matnr. CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN. ENDCASE. ENDMETHOD. ENDCLASS.

Event Double Click

  DATA: lo_events TYPE REF TO cl_salv_events_table. lo_events = lo_salv->get_event( ). SET HANDLER cl_event_handler=>on_double_click FOR lo_events. *create a new local class fo event handler CLASS cl_event_handler DEFINITION. PUBLIC SECTION. CLASS-METHODS on_double_click FOR EVENT double_click OF cl_salv_events_table IMPORTING row column. ENDCLASS. CLASS cl_event_handler IMPLEMENTATION. METHOD on_double_click. READ TABLE t_data INTO data(ls_data) INDEX row. CHECK sy-subrc = 0. SET PARAMETER ID 'MAT' FIELD ls_data-matnr. CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN. ENDMETHOD. ENDCLASS.

Using CL_SALV_TABLE

  Display ALV Grid: DATA: lo_salv TYPE REF TO cl_salv_table. TRY. CALL METHOD cl_salv_table=>factory IMPORTING r_salv_table = lo_salv CHANGING t_table = t_data. CATCH cx_salv_msg. ENDTRY. lo_salv->display( ).   Set GUI Status: CALL METHOD lo_salv->set_screen_status EXPORTING report = sy-repid pfstatus = 'STANDARD' "your PF Status name set_functions = lo_salv->c_functions_all.   Enable Save ALV Layout : DATA: ls_key TYPE salv_s_layout_key, lo_layout TYPE REF TO cl_salv_layout. ls_key-report = sy-repid. lo_layout = lo_salv->get_layout( ). lo_layout->set_save_restriction( if_salv_c_layout=>restrict_none ). lo_layout->set_key( ls_key ).   Enable Save Default Layout: lo_layout->set_default( abap_true ).   Set Column Optimized: DATA: lo_columns TYPE REF TO cl_salv_columns_table. lo_columns = lo_salv->get_columns( ). lo_columns->set_optimize( 'X' ).   Enable Saerch Help: DATA: ls_ref TYPE salv_s_ddic_ref...

How to Delete Specific layout in SAP

Image
 Need to execute transaction the Go to Settings  -> Layout -> Manages then select the line and press delete symbol.

Alpha IN/OUT to Handle Leading Zeros in SAP ABAP

 In SAP we use SHIFT keyword to delete leading zero's. Keyword is: SHIFT Variable LEFT DELETING LEADING '0'.  SHIFT Variable RIGHT DELETING LEADING '0'. We can also delete & add these zero's using new ABAP syntax. FM:  'CONVERSION_EXIT_ALPHA_OUTPUT' 'CONVERSION_EXIT_ALPHA_INPUT' DATA int_val TYPE char10 VALUE '0000012345' . DATA Chng_val TYPE char10. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = int_val IMPORTING output = Chng_val. Final result: 12345    DATA Chng_val TYPE char10 VALUE '12345' . DATA int_val TYPE char10. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = Chng_val IMPORTING output = int_val.  Final result:  0000012345