How to change released task to unreleased in SAP

November 21, 2025

Step 1: Go to SE38 then put program name RDDIT076 and run it, then paste your Request/Task and then execute.

Step 2: In a output section there have a Parent Request and it's sub task and there have Stat column which states D and R
D = Modifiable
R = Released


Step 3: To bring back to development section or unreleased you have to make the both task's stat value from R to D.

Step 4: Double click on it and click on edit button and choose D and save it.


 

 

 

 

 

 

 

 

 

 

IDE Used To Test This Code : SAP GUI.
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

Solution for object locked in inconsistent task in SAP

November 21, 2025

Step 1: Go to Tcode SE03 which is Transport Organizer Tools.
Step 2: Choose Unlock Objects (Expert Tool) under Requests/Tasks section.
Step 3: Put the Request/Task number and click execute tick button.
Step 4: After that you will get following message - 

Unlocking requests/tasks may cause inconsistencies.
Do you want to unlock the request/task?


Step 5: Click Unlock button. 

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

Get selection screen variables using Function Module in SAP

November 17, 2025

Using RS_TEXTPOOL_READ we can able to find all parameters, radio button name of any program.

Pass the program name in objectname parameter and internal table in tpool table.

Code Snippet:

DATA: it_tpool TYPE STANDARD TABLE OF textpool.

CALL FUNCTION 'RS_TEXTPOOL_READ'
    EXPORTING
        objectname = 'ZPROGRAM'
        action = 'EDIT'
        language = sy-langu
    TABLES
        tpool = it_tpool
    EXCEPTIONS
        object_not_found = 1
        permission_failure = 2
        invalid_program_type = 3
        error_occured = 4
        action_cancelled = 5
        OTHERS = 6.
    IF sy-subrc <> 0.
        * Implement suitable error handling here
    ENDIF.

you can find the contents in TPOOL table.

 


IDE Used To Test This Code : SAP GUI.
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

How to call smartforms without print dialog window

November 10, 2025

Code Snippet:
DATA: wa_control_parameters TYPE ssfctrlop,
            wa_output_options TYPE ssfcompop.

wa_control_parameters-preview = 'X'.
wa_control_parameters-no_dialog = 'X'.
wa_output_options-tddest = 'LP01'.

Then pass the control parameter and output options to the following parameters where you actually called the smartforms using driver program

control_parameters = wa_control_parameters
output_options     = wa_output_options

IDE Used To Test This Code :SAP GUI.
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

Calculate first and last date of a fiscal year in SAP

October 31, 2025

To determine the first and last date of a fiscal year, we can use a function module.

Name of function module - FIRST_AND_LAST_DAY_IN_YEAR_GET

Step 1 - First we need to find the fiscal year variant (PERIV) from T001 table.
Step 2 - Then pass the Fiscal Year in I_GJAHR and Fiscal Year Variant in I_PERIV parameter.

I_GJAHR = 2025
I_PERIV = V3




 

 

 

 

 

 

IDE Used To Test This Code :SAP GUI.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

Material BOM Explosion in SAP

October 10, 2025

In SAP we can use BOM Explosion using below function module, we need to pass some important parameter. 

CAPID - BOM Application ID (BEST).
EMENG - Required Quantity.
MTNRV - Material.
STLAL - Alternative BOM.
STLAN - BOM Usage.
WERKS - Plant.

we can find the multilevel BOM in STB table.

Code Snippet:

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
    EXPORTING
        alekz = 'X'
        capid = p_capid
        datuv = sy-datum
        emeng = p_emeng
        mktls = 'X'
        mehrs = 'X'
        mtnrv = lv_matnr
        stlal = lv_stlal
        stlan = lv_stlan
        stpst = 0
        svwvo = 'X'
        werks = lv_werks
        vrsvo = 'X'
    TABLES
        stb = it_stb
        matcat = it_matcat
    EXCEPTIONS
        alt_not_found = 1
        call_invalid = 2
        material_not_found = 3
        missing_authorization = 4
        no_bom_found = 5
        no_plant_data = 6
        no_suitable_bom_found = 7
        conversion_error = 8
        OTHERS = 9.
    IF sy-subrc <> 0.
    ENDIF.

IDE Used To Test This Code : SAP GUI.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

How to change MRP Area data using MD_MRP_LEVEL_CHANGE_DATA in SAP?

October 08, 2025

Requirement : Minimum Lot Size of a material in MRP area should update using MD_MRP_LEVEL_CHANGE_DATA function module.

Minimum Lot Size we can find in MM03->MRP1->ARP Areas

i_matnr = Material
i_werk = Storage Location
i_mrp_area = MRP Area
i_berty = Type of MRP Area
i_selfields = Pass the selfields structure
i_mdma = Pass the mdma structure
i_dpop = Pass the dpop structure

Code Snippet :
DATA: wa_selfields TYPE sdibe_massfields,
wa_mdma TYPE mdma,
wa_dpop TYPE dpop,
wa_berty TYPE mdlv-berty,
wa_return TYPE bapireturn1.

wa_mdma-matnr = wa_final-matnr. "Material
wa_mdma-werks = wa_final-plant. "Plant
wa_mdma-dismm = wa_final-mrptype. "MRP Type
wa_mdma-dispo = wa_final-mrpcntrl. "MRP Controller
wa_mdma-berid = wa_final-mrparea. "MRP Area
wa_mdma-bstmi = wa_final-moq. "Minimum order quantity

wa_selfields-xbstmi = 'X'. "Minimum order quantity

CALL FUNCTION 'MD_MRP_LEVEL_CHANGE_DATA'
EXPORTING
i_matnr = wa_final-matnr
i_werk = wa_final-strgloc
i_mrp_area = wa_final-mrparea
i_berty = lv_berty
i_selfields = wa_selfields
i_mdma = wa_mdma
i_dpop = wa_dpop
IMPORTING
e_error_return = wa_return.

IDE Used To Test This Code : SAP GUI.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

Where to find Material Group detail in SAP

July 15, 2025

You will find Material Group in MVKE table which contain material group number. 

MVKE - MVGR1
MVKE - MVGR2
MVKE - MVGR3
MVKE - MVGR4
MVKE - MVGR5

Material group number text will stored in different table.
MVKE - MVGR1 value text will stored in TVM1T.
MVKE - MVGR2 value text will stored in TVM2T.
MVKE - MVGR3 value text will stored in TVM3T.
MVKE - MVGR4 value text will stored in TVM4T.
MVKE - MVGR5 value text will stored in TVM5T

If you have any Question you can contact us or mail us. We will reply you as soon as possible.

How to get header text in SAP ABAP

April 01, 2025

How to get header text in SAP ABAP.
By using READ_TEXT we can able to read the header text of any standard transaction.

DATA: text_name TYPE tdobname,
lvlang TYPE tdspras,
textid TYPE tdid,
textobj TYPE tdobject,
ittline TYPE STANDARD TABLE OF tline.

lvlang = 'EN'.
textobj = 'VBBK'.
textid = 'Z022'.
textname = document number.

CALL FUNCTION 'READ_TEXT'
    EXPORTING
        client = sy-mandt
        id = textid
        language = lvlang
        name = textname
        object = textobj
    TABLES
        lines = ittline
    EXCEPTIONS
        id = 1
        language = 2
        name = 3
        not_found = 4
        object = 5
        reference_check = 6
        wrong_access_to_archive = 7
        OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.

sy-mandt = Client name.
pass the document number in textname.
Header text will appear in ittline table.
Text object and Text id we can able to find from Detail option.

IDE Used To Test This Code : SAP ABAP Editor.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

How to count decimal places using function module in SAP ABAP

March 30, 2025

Using a SAP inbuilt function module SWA_DETERMINE_DECIMALS, we can count the number of digits in decimal places.

In import, section we need to pass the number with decimal places and data type should be SWAEXPDEF-EXPR type.
 

In export section, we can get the count of decimal place number and export data type is DFIES-DECIMALS type.

Example: 


Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

Simple Try Catch program in SAP ABAP

July 17, 2024

Code:

DATA: res TYPE char10.
PARAMETERS: p1 TYPE char10,
            p2 TYPE char10.

TRY.
    res = p1 / p2.
    WRITE:/ res.
  CATCH cx_sy_zerodivide.
    WRITE: 'cannot divide by zero'.
ENDTRY.

IDE Used To Test This Code : SAP ABAP Editor.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

How to pass internal table data to range table in SAP ABAP

July 16, 2024

Code: 
TYPES: BEGIN OF ty_str,
         id   TYPE int4,
         name TYPE name1,
         site TYPE werks_d,
       END OF ty_str.

DATA: it TYPE STANDARD TABLE OF ty_str,
      wa TYPE ty_str.

DATA: r_site TYPE RANGE OF werks_d.

it = VALUE #( ( id = '1' name = 'AAA' site = 'H021' )
              ( id = '2' name = 'BBB' site = 'H067' )
              ( id = '3' name = 'CCC' site = 'H022' )
              ( id = '4' name = 'DDD' site = 'H055' )
              ( id = '5' name = 'EEE' site = 'H033' )
              ( id = '6' name = 'FFF' site = 'H064' ) ).

r_site = VALUE #( FOR <fs_it> IN it
                    ( sign = 'I'
                      option = 'EQ'
                      low = <fs_it>-site ) ).

cl_demo_output=>display( r_site ).

You can also use below code section -

r_site = VALUE #( FOR <fs_it> IN it
                    ( sign = if_fsbp_const_range=>sign_include
                      option = if_fsbp_const_range=>option_equal
                      low = <fs_it>-site ) ).

IDE Used To Test This Code : SAP ABAP Editor.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

GET_CURRENT_YEAR in SAP ABAP

July 10, 2024

GET_CURRENT_YEAR is a SAP's standard function module used in ABAP program to get current year.

Code:
DATA: lv_year TYPE bkpf-gjahr.

CALL FUNCTION 'GET_CURRENT_YEAR'
 EXPORTING
   bukrs         = '1000' "company code
   date          = sy-datum
 IMPORTING
*   CURRM         =
   curry         = lv_year
*   PREVM         =
*   PREVY         = .
WRITE: lv_year.

IDE Used To Test This Code : SAP ABAP Editor.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.