How to read SET values in SAP ABAP
June 08, 2026SET is created in SAP using GS01.
Below code section there two function module have used.
G_SET_GET_ID_FROM_NAME use to fetch the internal set id number.
G_SET_GET_ALL_VALUES use to get the actual set values by passing the internal set id number
Code :
DATA: lv_new_setid TYPE sethier-setid,
it_set_values TYPE STANDARD TABLE OF rgsb4.
CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'
EXPORTING
shortname = 'ZCUSTOMER'
IMPORTING
new_setid = lv_new_setid
EXCEPTIONS
no_set_found = 1
no_set_picked_from_popup = 2
wrong_class = 3
wrong_subclass = 4
table_field_not_found = 5
fields_dont_match = 6
set_is_empty = 7
formula_in_set = 8
set_is_dynamic = 9
OTHERS = 10.
IF sy-subrc = 0.
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
setnr = lv_new_setid
TABLES
set_values = it_set_values
EXCEPTIONS
set_not_found = 1
OTHERS = 2.
ENDIF.
LOOP AT it_set_values INTO DATA(wa_set_value).
WRITE:/ wa_set_value-from.
ENDLOOP.
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 change released task to unreleased in SAP
November 21, 2025Step 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, 2025Step 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, 2025Using 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, 2025Code 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, 2025To 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, 2025In 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, 2025Requirement : 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, 2025You 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, 2025How 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, 2025Using 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.





