SAP & Oracle partner and support companies

Loading

Archives 2025

SAP

Hello SAP EhP7 !!

Introduction to SAP EhP7 More than 750 business capabilities are included in SAP Upgrade Bundle 7 for SAP ERP 6.0, according to SAP news. Information maturing objects, MRP runs, and SAP Fiori are the main new components. The primary upgrade package for both the SAP HANA data set and the traditional validated data sets is SAP EhP7.

Being a straightforward ABAP engineer, I was curious to know how this 7.4 overhaul will affect an ABAPer. After reviewing the sap discharge reports and researching the framework, I have tried to document the advancements that ABAPers like me would find interesting.

Also, NEW and Worth Administrators are the main elements in SAP EhP7, which the ABAPer would utilize routinely.

NEW – Instance Operator
i)   NEW – Initial Value for All Types
ii)  NEW – Single Value for All Data Types
iii) NEW – Structures
iv) NEW – Internal Tables
v)  NEW – Classes

VALUE – Value Operator
i)   VALUE – Initial Value for All Types
ii)  VALUE – Structures
iii) VALUE – Internal Tables

In this post, I would like to show some usage of NEW Operators for Initial Value for All Types.

* Type declaration
TYPES: BEGIN OF ty_marc,
          matnr TYPE matnr,
          werks TYPE werks_d,
       END OF ty_marc.
 
* Type Ref To
DATA o_ref  TYPE REF TO ty_marc.
* Example 1
* Instantiate the object
 o_ref = NEW ty_marc( ).
 
 * Usage demo
 SELECT SINGLE matnr werks FROM marc INTO o_ref->*.
 IF sy-subrc EQ 0.
 * Displaying the fields as we used to do earlier
   WRITE:/ o_ref->*-matnr, o_ref->*-werks.
 ENDIF.

Please note NEW <TYPE>( ) is the syntax to instantiate any object.

* Example 2
* Instantiate the object using #
 o_ref = NEW #( ).
 
* Usage demo
 SELECT SINGLE matnr werks FROM marc INTO o_ref->*.
 IF sy-subrc EQ 0.
* Displaying the fields as we used to do earlier
   WRITE:/ o_ref->*-matnr, o_ref->*-werks.
 ENDIF.

Note NEW # () if it’s not too much trouble. It is implied that the article ref on the left determines the sort when “#” comes after NEW.

This brief post aims to raise your awareness of the new linguistic framework. The capabilities of the two constructor articulations mentioned above are comparable. In future postings, I’ll go into greater detail about NEW and Worth admins.

You can also read for:- How to Restore SAP Number Range Object ?

Oh no! Are you thinking about how the outcome might appear before I shut down? The same old thing. The yield is same to that of SAP EhP7. The yield show has not been redesigned.

If you liked it, please share it! Thanks!

YOU MAY BE INTERESTED IN

SAP PP Jobs: Unlocking Opportunities in PP

What is the demand for the SAP PP module?

SAP ABAP Interview Questions Real time Expectations

SAP

A to Z of OLE Excel in ABAP 7.4

ALV Report On SAP HANA

OLE Excel in ABAP 7.4: An All-Inclusive Guide for SAP Developers Let’s examine the SAP HANA: Opportunities and Challenges ALV Report. Everyone has been being cleared out by the HANA Tempest. According to a September 2017 SAP study, there were more than 1000 clients using S/4HANA at the time. Therefore, all professionals working on SAP would need to navigate the HANA waters tomorrow, if not immediately. ABAPers, who program ALV Reports every other week, will replace the SAP Professionals. Have you considered the relative advantages and disadvantages of planning an ALV report in SAP using HANA as the suite and data set?

ALV Reports are the Cockroaches of SAP world, which would survive every evolution.

The ALV’s roots, establishment, or starting place are the same in HANA World as they were in traditional data sets, such Choice SCREEN. Unfortunately, when we observe this, we frequently come to some conclusions. Checkboxes, radio buttons, choice screen blocks, and other features must be present on the screen. This is unfortunate since, on the one hand, Fiori Platforms feature stunning and dynamic screens with apps that improve Client Experience (UX) by using SAP UI5, and on the other, we have the standard ALV.

Rather cribbing about it, we want to recall that clients (actually) request ALV reports like standard T-Code yield for example ME2N (citing on the grounds that that was the prerequisite I got). Afterall everything isn’t about client experience. Complex business needs likewise get some weight.

Regardless, whether you are attempting to learn Fiori or SAPUI5, ALV reports can’t be supplanted. In this way, likewise begin investigating the new way you can make the ALVs.

How might we make our (ABAPers) lives merry and fascinating? Add HANA in with the general mish-mash and what you get is simpler to code (well not really) and all the more critically more prominent improvement in the exhibition.

The improvement in execution is exclusively credited to one thing that is the idea called “Code Push Down” or “Code to Information (Data set) Worldview”. Heard it anyplace? Try not to say No. We are at the twentieth part in our HANA ABAP Series.

What is Code Push Down? (ALV Report On SAP HANA – Opportunities And Challenges)

Here we have a tipping point. One can go for the strategy for utilizing Discs View alongside AMDP (if vital) or go with IDA. Utilizing IDA is much more straightforward than AMDP, yet possibly one can’t be a swap for the other. They play their own parts to play. In the following article, I will cover the distinctions and benefits of IDA against Albums.

Prior to looking down it would be smart to discover somewhat more about AMDP (ABAP Oversaw Data set System) and IDA (Coordinated Information Access).

So for ALV in HANA, we have the accompanying:

  1. Selection Screen
  2. Data is ready in CDS +/- AMDP

What next? Just connect them.

3. Applying selection screen criteria into CDS view entries.

The third step is a piece precarious. We again have various open doors here.

3.1 Either pass all the determination screen channels into AMDP ( NOT Compact discs View as a result of the way that Cds Perspectives are defined and can’t take more than one incentive for a solitary field and choice screen of the ALV report has select choices which are in range tables)

OR

3.2 Get every one of the passages from Compact discs View into your Application Layer and afterward continue with regular coding practice.

At this point, experienced ABAPers would agree that that first methodology (AMDP) would do every one of the positive qualities regarding execution.

Now we have narrowed down to:

  1. Choice Screen
  2. Information is prepared in Discs +/ – AMDP
  3. Applying choice screen measures into Discs view sections utilizing AMDP and bringing just required passages into AS layer and continuing with regular SALV manufacturing plant class utilizing Oh no.

Technical Points:

  1. Conversion of SELECT-OPTIONS into Dynamic “WHERE CLAUSE”: When the standard determination screen is constructed, the main obstacle is incorporate the select choices into AMDP. To accomplish that we have the accompanying code piece:
DATA(lv_where) = cl_shdb_seltab=>combine_seltabs(
it_named_seltabs = VALUE #(
( name = 'MATNR' dref = REF #( so_matnr[] ) )
( name = 'EBELN' dref = REF #( so_ebeln[] ) )
) ).

Trust you can grasp the above code. Else, the beneath elective for a similar activity can assist you with bettering.

cl_shdb_seltab=>combine_seltabs(
EXPORTING
it_named_seltabs = VALUE #(
( name = 'MATNR' dref = REF #( so_matnr[] ) )
( name = 'EBELN' dref = REF #( so_ebeln[] ) )
)
RECEIVING
rv_where = DATA(lv_where) ).

2. Using Dynamic where clause in AMDP: The following test is to utilize the where condition. There is an element in SAP AS 7.40 and higher of “APPLY Channel”. The lv_where statement worked above is passed to AMDP technique boundary ip_filters.

Conclusion: ALV Report On SAP HANA – Opportunities And Challenges

Making the most of HANA DB and HANA instruments like HANA Studio we enjoy following benefits ( opportunity ):

  1. Since there is code push down and a greater portion of the information bringing is completed at HANA DB alongside collections, totals, and midpoints, the execution was further developed.
  2. Powerful on-the-fly custom naming of the ALV result fields [may be completed with CDS].
  3. Dynamic SELECT questions in AMDP based on the data provided by the client and the content stored in the database [for example, if the database contains columns for City and Country, we may use the CASE articulation to conclude whether or not the input city provided by the client is the capital].
  4. Get rid of it for every section. [Instead, use internal joins]. Have we just found ourselves in yet another predicament?.

The opposite side of the story, challenges:

  • At the point when we go with Discs Perspectives to extricate information into AS layer, then, at that point, there might be still some presentation issues (despite the fact that Cds relics would in any case give great exhibitions, still some unacceptable utilization of Cds can blow up).

Kindly trust that the following article will get a brief look at the genuine code to exhibit all the abovementioned and IDA. Along these lines, if it’s not too much trouble, remain tuned and get yourself HANA-tized.

Now we want to hear from you.

Kindly leave your input, stories and speedy remarks beneath.

YOU MAY LIKE THIS

Auto Refresh ALV Using CL_GUI_TIMER

Courses For Sap ABAP On HANA Training

Oracle cloud for manufacturing

SAP ABAP Interview Questions Real time Expectations

SAP

Creating Dynamic Internal Table

Creating dynamic internal table in ABAP In one of our post, we showed the use of Dynamic Where Condition . In this article, Creating Dynamic Internal Table we would show one out of the numerous ways of creating Dynamic Inward Table and show it in ALV yield.

Let’s assume you have a necessity where you need to show a report to demonstrate one Material is available in the number of Plants. Say your feedback material ‘M1’ is available in two plants say ‘P1’ and ‘P2’. So the result ALV report ought to show just two three segments, M1, P1 and P2. Let’s assume you have another material ‘M2’ which is available in 5 plants ‘P1’, ‘P2’, ‘P3’, ‘P4’ and ‘P5’. Then the result table would have six segments. M1, P1, P2, P3, P4 and P5.

Make a note, the quantity of sections are changing in view of the information. Allow us to see a genuine model. Creating Dynamic Internal Table.

Check the MARC table.

CREATE_DYNAMIC_TABLE

You can also read for:- ABAP for SAP HANA. ALV Report On SAP HANA – Opportunities And Challenges

Above screen capture shows that Material ‘100522’ is available in two plants. Our ALV would show as underneath.

Check the MARC screen capture, Material ‘100567’ is available in four plants. Our ALV would show as beneath.

Did you see, the quantity of segments are changing powerfully according to the information? This should be possible in numerous ways, yet the most helpful way is to make dynamic design/inner table and show it.

Capability Module ‘DDIF_FIELDINFO_GET’ would assist us with getting table field data. Really take a look at the code beneath, we are supplanting ‘MARC-WERKS’ field name, with the genuine Plant number. This was only a particular undertaking prerequisite. You could have another prerequisite.

Dynamic Internal Table

Material is a decent segment yet Plants are dynamic in view of information from MARC. Check we are circling through the interior table and utilizing FM ‘DDIF_FIELDINFO_GET’ to decide and populate field index data.

When we have the field index (i_fcat), we want to construct the unique inside table with the not entirely set in stone by i_fcat. For this model, we are utilizing technique ‘CREATE_DYNAMIC_TABLE’ of class CL_ALV_TABLE_CREATE.

———————————————————–

Updated: 19th Dec 2017 – Feedback from Steve

Consider adding:
I_LENGTH_IN_BYTE = ‘X’
to the CALL METHOD cl_alv_table_create=>create_dynamic_table statement
I had a problem where I needed the dynamic table to create a p(7)/3, without that additional statement it calculates a P(4)/3.

———————————————————–

CREATE_DYNAMIC_TABLE

The under two stages are the main ones. Here we are allocating the unique construction to the <field-symbol> table and <field-symbol> workspace which would be utilized later to show the ALV.

* Assign the structure of dynamic table to field symbol
ASSIGN i_dynamic_table->* TO <i_dyn_table>.

* Create the dynamic work area
CREATE DATA wa_dyn_line LIKE LINE OF <i_dyn_table>.
ASSIGN wa_dyn_line->* TO <wa_dyn>.

There is some mathematic done to stamp ‘X’ for the segment where the material is available. So don’t be confounded. In troubleshooting, that’s what it shows despite the fact that MATNR has 18 characters, the unique table show 36 (simply the twofold). Same with Plant, it shows 8 rather than 4. Thus, this is the sort of thing you need to check before you put your information.

Whenever you have populated the information in the powerful inside table, showing information in ALV is a cake walk. Simply utilize the FM ‘REUSE_ALV_GRID_DISPLAY’.

Really look at the code conduct in Troubleshooting mode”

Dynamic Internal Table

Check I_FCAT table, it has 4 columns of fields. This implies, the unique interior table would have 4 segments. One fixed for Material and 3 dynamic for plants.

CL_ALV_TABLE_CREATE

This is the class and technique which really makes the powerful inward table.

Dynamic Internal Table

Check I_DYNAMIC_TABLE, it has now 3 segments for plants. This is the construction you want. Presently make the inward table and workspace and populate your last information and show it.

CL_ALV_TABLE_CREATE

Allow us to see, how the result would look like when we input 3 materials which are accessible in different plants.

Check, the quantity of plant segments are the association of the multitude of three materials. Isn’t it dynamic?

Kindly track down the functioning system for the above prerequisite here.

REPORT elearning. 
*----------------------------------------------------------------------*
* Created by   : eLearning (https://eLearning.com/)                    *
* Purpose      : Program to show Dynamic Internal table                *
* Visit https://eLearning.com/ for SAP Technical Tips & Solutions     *
*----------------------------------------------------------------------*
*---------------------------------------------------------------------*
* POOLS                                                              *
*---------------------------------------------------------------------*
TYPE-POOLS: slis.
*---------------------------------------------------------------------*
* TABLES                                                              *
*---------------------------------------------------------------------*
TABLES: mara.
*---------------------------------------------------------------------*
* TYPES
*---------------------------------------------------------------------*
TYPES: BEGIN OF x_data,
         matnr TYPE matnr,
         werks TYPE werks_d,
       END OF x_data.
*---------------------------------------------------------------------*
*  DATA                                                               *
*---------------------------------------------------------------------*
DATA:
* Internal tables
  i_data          TYPE STANDARD TABLE OF x_data,
  i_data_temp     TYPE STANDARD TABLE OF x_data,
  i_fcat          TYPE lvc_t_fcat,
  i_dynamic_table TYPE REF TO data,
  i_plant         TYPE STANDARD TABLE OF x_plant,
  i_fieldcat      TYPE slis_t_fieldcat_alv,

* Work ara
  wa_fcat         TYPE lvc_s_fcat,
  wa_dyn_line     TYPE REF TO data,
  wa_plant        TYPE x_plant,
  wa_data         TYPE x_data,

* Variable
  v_field_name    TYPE fieldname,
  v_tabix         TYPE sytabix,
  v_fieldname     TYPE fieldname,
  v_seltext       TYPE scrtext_l.
*---------------------------------------------------------------------*
*  Field Symbols                                                      *
*---------------------------------------------------------------------*
FIELD-SYMBOLS:
  <i_dyn_table>   TYPE STANDARD TABLE,
  <i_final_table> TYPE STANDARD TABLE,
  <wa_dyn>        TYPE any,
  <wa_final>      TYPE any.
*---------------------------------------------------------------------*
* SELECTION SCREEN                                                    *
*---------------------------------------------------------------------*
SELECT-OPTIONS: s_matnr FOR mara-matnr.
*---------------------------------------------------------------------*
* INITIALIZATION                                                      *
*---------------------------------------------------------------------*
INITIALIZATION.
* Select data
*---------------------------------------------------------------------*
* START-OF-SELECTION.                                                 *
*---------------------------------------------------------------------*
START-OF-SELECTION.
  PERFORM sub_slect_data.

*---------------------------------------------------------------------*
* END-OF-SELECTION.                                                   *
*---------------------------------------------------------------------*
END-OF-SELECTION.
* Populate the dynamic columns needed for each run
  PERFORM sub_populate_catlog.

* Build the dynamic internal table
  PERFORM sub_build_int_table.

* Build ALF Field Catalog information
  PERFORM sub_alv_field_cat.

* Display data
  PERFORM sub_display_data.

*---------------------------------------------------------------------*
* SUB ROUTINES                                                        *
*---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Form  SUB_SLECT_DATA
*&---------------------------------------------------------------------*
FORM sub_slect_data .

  SELECT matnr werks
    INTO TABLE i_data
    FROM marc
    WHERE matnr IN s_matnr.
  IF sy-subrc EQ 0.
    SORT i_data BY matnr.

    i_data_temp[] = i_data[].
    SORT i_data_temp BY werks.
    DELETE ADJACENT DUPLICATES FROM i_data_temp
    COMPARING werks.
  ENDIF.

ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  SUB_POPULATE_CATLOG
*&---------------------------------------------------------------------*
FORM sub_populate_catlog .
  v_field_name = 'MATNR'.
* There is one Material column
  PERFORM sub_pop_field_catlog USING v_field_name.

  v_field_name = 'WERKS'.
* There would be 'N' number of dynamic Plant columns
* depending on the material and plants combination
  LOOP AT i_data_temp INTO wa_data.
    PERFORM sub_pop_field_catlog USING v_field_name.
  ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  SUB_POP_FIELD_CATLOG
*&---------------------------------------------------------------------*
FORM sub_pop_field_catlog  USING    p_l_field_name TYPE fieldname.

  DATA: l_i_dfies  TYPE STANDARD TABLE OF dfies,
        l_wa_dfies TYPE dfies.

* Call FM
  CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
      tabname        = 'MARC'
      fieldname      = p_l_field_name
    TABLES
      dfies_tab      = l_i_dfies
    EXCEPTIONS
      not_found      = 1
      internal_error = 2
      OTHERS         = 3.
  IF sy-subrc EQ 0.

    CLEAR l_wa_dfies.
    READ TABLE l_i_dfies INTO l_wa_dfies INDEX 1.
    CLEAR wa_fcat.
* Since we want the Plant number to be the header text
* Replacing the field name with actual plant value
    IF v_field_name = 'WERKS'.
      l_wa_dfies-fieldname = wa_data-werks.
    ENDIF.

    MOVE-CORRESPONDING l_wa_dfies TO wa_fcat.
    APPEND wa_fcat TO i_fcat.
  ENDIF.

ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  SUB_BUILD_INT_TABLE
*&---------------------------------------------------------------------*
FORM sub_build_int_table .

* Prepare the dynamic internal table with required columns of each run
  CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
      it_fieldcatalog           = i_fcat
    IMPORTING
      ep_table                  = i_dynamic_table
    EXCEPTIONS
      generate_subpool_dir_full = 1
      OTHERS                    = 2.
* Assign the structure of dynamic table to field symbol
  ASSIGN i_dynamic_table->* TO <i_dyn_table>.

* Create the dynamic work area
  CREATE DATA wa_dyn_line LIKE LINE OF <i_dyn_table>.
  ASSIGN wa_dyn_line->* TO <wa_dyn>.


ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  SUB_ALV_FIELD_CAT
*&---------------------------------------------------------------------*
FORM sub_alv_field_cat .

* Build field catalog for Material
  PERFORM sub_fill_alv_field_cat USING
        'MATNR' '<I_DYN_TABLE>' 'L' 'Material Number' 36.

* Number of Plant columns would be dynamic for Plants
  LOOP AT i_data_temp INTO wa_data.

    v_fieldname = wa_data-werks.
    v_seltext =   wa_data-werks.

    PERFORM sub_fill_alv_field_cat USING
              v_fieldname '<I_DYN_TABLE>' 'L' v_seltext 8.

  ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  SUB_FILL_ALV_FIELD_CAT
*&---------------------------------------------------------------------*
FORM sub_fill_alv_field_cat  USING
                             p_fldnam    TYPE fieldname
                             p_tabnam    TYPE tabname
                             p_justif    TYPE char1
                             p_seltext   TYPE dd03p-scrtext_l
                             p_outlen    TYPE i.

  DATA l_lfl_fcat TYPE slis_fieldcat_alv.

  l_lfl_fcat-fieldname  = p_fldnam.
  l_lfl_fcat-tabname    = p_tabnam.
  l_lfl_fcat-just       = p_justif.
  l_lfl_fcat-seltext_l  = p_seltext.
  l_lfl_fcat-outputlen  = p_outlen.

  APPEND l_lfl_fcat TO i_fieldcat.

  CLEAR l_lfl_fcat.

ENDFORM.

*&---------------------------------------------------------------------*
*&      Form  SUB_DISPLAY_DATA
*&---------------------------------------------------------------------*
FORM sub_display_data .

  DATA: l_count     TYPE i,
        l_factor    TYPE i,
        l_wa_layout TYPE slis_layout_alv.

  LOOP AT i_data INTO wa_data.

    CLEAR: l_factor, l_count.

    READ TABLE i_data_temp WITH KEY werks = wa_data-werks
    TRANSPORTING NO FIELDS
    BINARY SEARCH.
    IF sy-subrc EQ 0.

      <wa_dyn>+0(18) = wa_data-matnr.
      l_factor = sy-tabix - 1.
      l_count = 36 + ( 8 * l_factor ).

      <wa_dyn>+l_count(8) = 'X'.

      AT END OF matnr.
        APPEND <wa_dyn> TO <i_dyn_table>.
        CLEAR <wa_dyn>.
      ENDAT.
    ENDIF.

  ENDLOOP.

  l_wa_layout-colwidth_optimize = 'X'.
  l_wa_layout-zebra = 'X'.

* Funtion module for displaying the ALV report
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = sy-repid
      is_layout          = l_wa_layout
      it_fieldcat        = i_fieldcat
    TABLES
      t_outtab           = <i_dyn_table>
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.


ENDFORM.

If you have any desire to get such commonsense changes and deceives directly to your inbox, kindly Buy in. We regard your security and view safeguarding it in a serious way.

In the event that you loved this post, kindly hit the offer buttons. If it’s not too much trouble, similar to us at facebook and support us. Assuming that you have any ideas, analysis, remarks or questions, kindly remark or connect with us.

Many thanks for your time!!

YOU MAY LIKE THIS

ALE and IDoc in SAP ABAP: A Deep Dive

Parallel cursor in SAP ABAP

Epic Evolution of ABAP Programming

SAP

Dynamic Where Condition usage in Database queries

SQL Tips: Dynamic WHERE Condition in Database Queries Let’s begin by discussing how to use dynamic where conditions in database queries. We desire Dynamic Where Condition for data set (DB) inquiries, but there aren’t many changes. Importance: Your software may determine during runtime which fields in the database table should be used for the DB query. To support such Dynamic Where Conditions, we can write our own unique code. In any case, we are aware of the effort and suffering required to write such a code. Thankfully, we can fulfill the requirement by using the Standard SAP capability module CRS_CREATE_WHERE_CONDITION. Using dynamic where clauses in database queries

Test Model:

We should think about it because we have a program that can comprehend part of the reasoning. Finally, it concludes that, in light of the fields MATNR (Material Number) and MTART (Material Sort), it should do an inquiry on the Data Set table MARA. The question can be asked in a few other possible fields, and the selection will be decided at runtime. Until run time, the table fields and their comparison values are unknown. Therefore, a dynamic where condition is what we truly want for the data set inquiry. Under such circumstances, you may choose to look at every possible combination of fields that could be used in the where condition and compose your custom code to produce a Dynamic Where Condition or you can simply utilize a Capability Module (FM) which will finish the work you.

You can also read for:- list of data types in sap abap

We will examine what is going on thinking about a program, with a determination screen having both the fields MATNR and MTART. (Allow us to accept these two fields and their comparing values won’t be accessible until runtime). If it’s not too much trouble, note, this program is composed to make sense of the Dynamic Where Condition. In real venture, you wouldn’t have the boundaries in determination screen. You may very well know the table and field name and values in those fields would be populated at runtime.

For straightforwardness, we have made these fields as a component of determination screen to populate our Dynamic Where Condition.

* Types
TYPES: BEGIN OF x_mara,
         matnr TYPE matnr, "Material Number
         mtart TYPE mtart, "Material Type
       END OF x_mara.

DATA:
* Internal table
  l_i_range  TYPE STANDARD TABLE OF crmselstr,
  l_i_output TYPE STANDARD TABLE OF mcondition,
  l_i_mara   TYPE STANDARD TABLE OF x_mara,

* Work area
  l_wa_range TYPE crmselstr,

* Variable
  v_matnr    TYPE mara-matnr,
  v_mtart    TYPE mara-mtart.
* Selection Screen
SELECT-OPTIONS: s_matnr FOR v_matnr,
s_mtart FOR v_mtart.

* For Select Option 1
LOOP AT s_matnr. "Looping to get multiple (single) values
  l_wa_range-table = 'MARA'. "Name of the DB table
  l_wa_range-field = 'MATNR'. "Field name the user has selected
  l_wa_range-sign = s_matnr-sign. "Sign
  l_wa_range-option = s_matnr-option."option
  l_wa_range-low = s_matnr-low. "Lower Value
  l_wa_range-high = s_matnr-high. "Higher Value
  APPEND l_wa_range TO l_i_range.
ENDLOOP..

* For Select Option 2
LOOP AT s_mtart. "Looping to get multiple (single) values
  CLEAR l_wa_range.
  l_wa_range-table = 'MARA'. "Name of the DB table
  l_wa_range-field = 'MTART'. "Field name the user has selected
  l_wa_range-sign = s_mtart-sign. "Sign
  l_wa_range-option = s_mtart-option. "option
  l_wa_range-low = s_mtart-low. "Lower Value
  l_wa_range-high = s_mtart-high. "Higher Value
  APPEND l_wa_range TO l_i_range.
ENDLOOP.
IF NOT l_i_range[] IS INITIAL.

* Call the FM to create the Dynamic Where condition
  CALL FUNCTION 'CRS_CREATE_WHERE_CONDITION'
    TABLES
      ti_range      = l_i_range
      to_cond       = l_i_output
    EXCEPTIONS
      invalid_input = 1
      OTHERS        = 2.

  IF sy-subrc = 0.

* Special way to write the query
    SELECT matnr "Material Number
    mtart "Material Type
    FROM mara
    INTO TABLE l_i_mara
    WHERE (l_i_output).

    IF sy-subrc = 0.

    ENDIF.

  ENDIF. "IF sy-subrc = 0: SELECT matnr mtart

ENDIF. "IF NOT l_i_range[] IS INITIAL.

Please note above: The Dynamic Where Condition table has to be put in brackets during the SELECT statement

WHERE (l_i_output).

Let us check the values in debug mode.

In choice screen we gave two qualities to material number field and one worth to material sort.

Dynamic ABAP

Check the range internal table l_i_range has data from two fields.

Dynamic Where Condition

Function module CRS_CREATE_WHERE_CONDITION smartly converts the data to Dynamic Where Condition in internal table l_i_output.  Isn’t this cool? 

Dynamic Where Condition

Why would it be wise for us to set aside time to write code to put up our own Dynamic Where Condition at the moment when SAP has provided this FM? You now know which FM to contact the next time you need a Dynamic Where Proviso..

Much thanks for your time!!

YOU MAY BE INTERESTED IN

How to Convert JSON Data Structure to ABAP Structure without ABAP Code or SE11?

Best Practices for SAP ABAP Development: A Comprehensive Guide

A Comprehensive Guide to SAP ABAP Training Online

SAP

Pop Up Debugging [ROBO 2.0]

Only a few years ago, we explained how to use a scratchpad to investigate the Spring Up Screen. Please take a look at this instructional exercise on Spring Up Troubleshooting Stunt. ROBO [Pop Up Troubleshooting By Notebook File] is the moniker I gave it. Simply ROBO. Don’t ask me what it means, please. Let’s get started with ROBO 2.0 Pop Up Debugging..

In this article, Pop Up Debugging [ROBO 2.0] we will attempt to make sense of another methods of Spring Up Troubleshooting utilizing SAP Easy route

  1. ROBO 2.0 [PopUp Debugging by SAP Shortcut ]
  2. ROBO Chitti [ Pop Up Debugging by SAP Shortcut with More Ease ]

1. ROBO 2.0 [ Pop Up Debugging By SAP Shortcut ]

We accept, the greater part of us are familiar with Spring Up Troubleshooting with SAP Easy route. In any case, on the off chance that you don’t know, let me tell the best way to make and utilize SAP Easy route to Troubleshoot SAP Spring Up. This is my ROBO 2.0 (nothing official about it) :P.

SAP Shortcut creation Steps as below.

You can create shortcut from any screen

Type = ‘System Command’; Transcation = ‘/H’; Location = ‘Desktop’ (wherever you want)

Presently we will perceive how might we utilize a similar SAP Easy route to Troubleshoot the Spring Up!.

Step:1 [ I have a screen where I have to debug the Pop Up ]

Step:2 I limited every one of my applications by utilizing Window + D alternate route then I held and hauled the SAP alternate way which I made in above advances and moved or explored to Drain GUI Application that was at that point opened in Taskbar Level for example as beneath

That’s it.

2. ROBO CHITTI [ Pop Up Debugging by Shortcut with more Ease ]

We created a SAP alternate route up till this point, moved out of the work area, dropped something comparable on Spring Up, and fixed it. There is an issue with restricting the number of meetings that may be held, figuring out the quickest way, and then dragging it to the spring screen. If everything else is equal, we can make the interaction easier by sticking the GUI alternate path to the taskbar. The simplest way to nail any application to the taskbar is to right-tap it and pin it to the taskbar. You can also use other methods you are familiar with. When the other option isn’t working, launch the SAP GUI application that has to be looked into. This time it is easier.

You can also read for:- Advance SAPUI5 – Integration of Google Maps JavaScript API with SAPUI5 App

Simply drag the alternate way you have stuck to the spring up screen.

I want to believe that you previously sorted out the benefit of this technique. Don’t bother limiting all applications [with Window + D] to move the SAP Easy route on to Spring Up and don’t bother agonizing over exploring to Drain GUI Application by holding the alternate way. Just we can drag a similar easy route (Upwards) from Errand Bar and Drop it on to ‘Spring Up.’

I have no doubt that many of you were somewhat aware of both of these methods. Nevertheless, because nobody can truly know, we genuinely thought about posting this because it might enlighten some young or old minds..

YOU MAY LIKE THIS

10 Real-World SAP ABAP Programming Examples (with Code!

Building custom SAP Fiori applications for improved sales efficiency

Back-End Development

SAP

Easy Trick to Disable Hold Button in PO (ME21N) using BADI

I want to share a simple trick to make use of a BAdI and disable Hold button in Purchase Order Creation (t-code ME21N). Let’s go deep into the Easy Trick to Disable Hold Button in PO ME21N using BADI.

  • On initial step, ensure Keep button actually exists. Check the Hold featured in yellow.
  • Open BAdI Developer through T-Code SE19. On BAdI Developer screen, pick Exemplary BAdI, on BAdI name segment fill ME_HOLD_PO and afterward click on Make Impl. button. In this step, we duplicate default standard BAdI which is ME_HOLD_PO into our BAdI name.
  • Input execution name as our BAdI name, remember to begin your BAdI Execution name with Z or Y, for instance I utilized ZHOLDPO name for my BAdI name.
  • Input some text for the BAdI Execution depiction.
  • Remember your BAdI Execution for a bundle and dole out into a vehicle demand to ship it to Quality and consequently to Creation framework.
  • Click on Point of interaction Tab, and afterward Double tap on Technique IS_ALLOWED.
  • It opens the ABAP Supervisor. To see existing boundary, simply click signature button.
  • We can see boundary CH_ALLOWED. We want to utilize this boundary to cripple Hold Button in the PO. Put your code among strategy and endmethod. We have hard-coded CH_ALLOWED with invalid worth. It implies Hold button won’t exist any longer. Remember to Enact your BAdI Execution.
  • Simply press enter on spring up, this spring up seems on the grounds that there is one more article with inert status.
  • Simply ensure your code is enacted. Click back on back button.
  • In any case, BAdI status is as yet latent, and Runtime Conduct is “Execution won’t be called”. You can definitely relax, it implies BAdI was not executed as expected. We simply have to Enact the BAdI Execution here.
  • After enactment of BAdI Execution, status will be Dynamic and Runtime Conduct will be “Execution will be called”.
  • Last step. How about we approve our adjustment of the PO screen. Bingo!! The Hold button which you found in the absolute first screen capture, doesn’t exist. Presently, go an illuminate the business group who requested it. Your task is finished for the afternoon.

This is a basic arrangement once you track down it. In any case, when you don’t have a clue about the BAdI name, you need to scramble around and google. Easy Trick to Disable Hold Button in PO ME21N using BADI.

YOU MAY LIKE THIS

How to check your custom ABAP code for SAP BTP ABAP Environment

10 Real-World SAP ABAP Programming Examples (with Code!)

Number Range tcode in SAP

Create and Consume Business Add-in(BAdI) in ABAP

SAP

Quick Guide: SAP Debugger New Tool for Memory Stack

The SAP Debugger New Tool for Memory Stack is a powerful new feature that makes debugging in SAP ABAP more efficient and developer-friendly. Whether you’re trying to retrieve hidden field values from a transaction or access global variables during runtime, this tool gives you a clear path through the memory stack. In this quick guide, you’ll learn how to use the SAP Debugger’s new memory stack tool in just 5 steps — perfect for solving those tricky BADI and client exit challenges.

In this article, Fetching Data from Memory Stack Using New Tool (in Debugger), we will gain proficiency with a short and straightforward stunt to get to separate qualities standard exchange code.

Essentially, we would take advantage of the Memory Stack at Run-Time involving the New Apparatus in Debugger. Assuming in any meeting somebody asks you, do you realize Memory Stack Programming? Subsequent to going through this article, your response ought to be a major certain certifiable.

Following are the steps that need to be followed:

Get the program name and field information from the screen (utilizing F1)

Add a breakpoint in the exit/BADI

Execute the exchange and actually look at the worth at runtime utilizing New Apparatus (Devices – > Exceptional Instrument -> Stacked Projects)

Add code in the exit/BADI for getting information from the screen field

Stranger than fiction can be the truth. I’ll give you a very simple constant-use model. In SAP, there is a mechanism to include one-time seller details when submitting a purchase request. The length of the approval PINCODE must be included.

We were involving Actually look at strategy for BADI ME_PROCESS_PO_CUST for approval in PO. Yet, found that the location subtleties were not open in the BADI.

We followed the 4 stages referenced previously. We found the program name and field information.

This image has an empty alt attribute; its file name is image001.png

Added the debugger and executed the exchange. In the debugger apparatus, go to New Device choice.

new tool in debugger

Alert: In the event that your debugger takes you to the Standard Tab naturally, you wouldn’t view as the “New Apparatus”. Try not to overreact. Simply click Work area 1 or Work area 2 or Work area 3 and New Device would show up for your administration.

This image has an empty alt attribute; its file name is newtool.jpg

Go to Stacked Projects choice in Extraordinary Devices.

Loaded Program

Select Worldwide Information tab where we will actually want to see every one of the worldwide factors of each program.

New Tool in SAP

Allow us now to track down the program and field for Address information.

This image has an empty alt attribute; its file name is image007.png

Definitely, we got the ADDR1_DATA values. So presently we arrived at the last step – the code :).

  FIELD-SYMBOLS:<fs1> TYPE any.

* Make the system know from which Program we need the data
  DATA:post_code(40) TYPE c VALUE '(SAPLSZA1)ADDR1_DATA-POST_CODE1'.

* Assign the value to a field system
  ASSIGN (post_code) TO <fs1>.

  IF  <fs1> IS ASSIGNED.
* Do your validation
    IF strlen( <fs1> ) NE '6'.
          MESSAGE 'Postal Code should be of length 6.' TYPE 'E'.
    ENDIF.

  ENDIF.

Fundamentally, we just dove profoundly into the memory stack at the run-time and searched for all projects that were stacked in the framework for consummation of the specific exchange. Utilizing the New Instrument, we tracked down the Worldwide Information. When you have the Worldwide Information, you can simply get that information in your program utilizing Field Image.

Trust you like this stunt. This is a basic arrangement which we want to do in each venture. On the off chance that you are a novice on SAP ABAP, bookmark this article. You would require this for your most memorable Memory Stack Programming.

You can execute this equivalent stunt to get any worldwide information like table, structures, factors, objects and so forth.

Note: There is a restriction. On the off chance that the variable, workspace, table and so forth are NOT announced as Worldwide on the stacked projects, then, at that point, we Can’t recover its worth utilizing the above technique.

YOU MAY BE INTERESTED IN

Future of ABAP on Cloud

ABAP Development Environment in the Cloud

ALE and IDoc in SAP ABAP: A Deep Dive

SAP

How to Schedule dependent Batch job in sequence in SM36?

In the time of in-memory, HANA, Fiori, SAPUI5 and other future ABAP, we are pulling you back to the pre-notable time frame. We will discuss planning position which ought to set off after another occupation is finished. To put it plainly, we will perceive how to plan subordinate positions. How to Schedule dependent Batch job in sequence in SM36?

The inspiration for this article is a new encounter where a specialist with over 10 years of involvement couldn’t plan a bunch work which would set off following another occupation would finish.

What number of you have seen this blunder? Let’s start our practical on How to Schedule dependent Batch job in sequence in SM36?

“There is no such thing as work Xxxxxxx or doesn’t have status ‘planned’/delivered’”.

Job XXXXXXX does not exist or does not have status 'scheduled'/'released'

There are numerous unanswered inquiries in famous question and answer discussions for this issue.

Indeed, even following 10 years of SAP insight, on the off chance that you follow the beneath moves toward plan bunch occupations in succession, possibly you have never booked subordinate group occupations which should set off after a task finishes or you were consistently in projects where there were a few committed groups who did all cluster work booking.

Allow us to perceive how the vast majority of the ABAPers wrongly think a reliant bunch occupation ought to be planned.

1. Execute the first program in background mode.

First job is active

The expectation is, when the first active job (in this example, ZWM_UPDATE_SWBS_CHAR) is complete, another job should trigger.

2. Presently, plan the second program which ought to set off after the main program finishes. Go to t-code SM36. Give Occupation Name hit enter (or Steps) and give the Program Name and Variation and hit save.

1
2

3. It would show the variation screen. Hit Back symbol to return to the SM36 beginning screen. Presently hit Start Condition (you realize this is the spot which controls the trigger).

31

4. Hit After Occupation button. Give the primary work name which you planned for stage 1. Hit save and you expected your work was finished.

4

Oh no, you receive this message. “There is no such thing as work or doesn’t have status ‘booked’/delivered’”.

How did you veer off-track?
The response is in the mistake message itself. You can plan subordinate positions just if there should be an occurrence of ancestor occupations which are in status Booked or Delivered. Yet, your most memorable occupation was at that point in Dynamic status when you attempted to plan the second work subject to the first.

Right moves toward plan subordinate positions in arrangement.

Part I – Schedule First Job
1. Go to t-code SM36 to plan the principal work.
Give the work name for the principal program. Hit Step symbol or hit enter. Give the program name and variation. Hit Save.

7

You would be in Sync Rundown Outline screen. Hit back.

8

2. You are back to the underlying screen of SM36. Stir things up around town symbol. You would receive the message “Occupation saved with status: Booked”. Your most memorable occupation would be planned effectively.

9

3. Twofold check that the main occupation is in booked status. Hit Own Positions in the SM36 screen. Our occupation is in booked status.

10_0
10

You have done the initial segment accurately.

Part II – Release Second Job
Presently moves toward plan the reliant positions which ought to set off after the principal work is finished.

4. Go to t-code SM36 to plan the subsequent work.
Give the work name for the subsequent program. Hit Step symbol or hit enter. Give the program name and variation. Hit Save.

11

You would be in Sync Rundown Outline screen. Hit back.

12

5. You are back to the initial screen of SM36. Now hit Start Condition icon.

6. Hit, After Occupation button. Give the primary work name which you planned for the step above. Hit Check and afterward Save symbol.

13

7. You are back to the underlying screen of SM36. Hit Save symbol. You would receive message “Occupation saved with status: Delivered”.

14

8. Twofold check that the subsequent occupation is in delivered status. Hit Own Positions in the SM36 screen. Our subsequent occupation is in delivered status.

16_0

Part III – Trigger/Start first Job

9. Presently we really want to begin our most memorable work. Go to SM36. Hit Own Positions. Select your most memorable work and hit Delivery button. In the following screen, hit Quick button (or Date/Time assuming you need) and hit check and Save symbol.

15


Your most memorable occupation is set off. Check the underneath screen. According to it, the occupation is in Prepared status.

Presently stand by and watch!!! The second the main occupation finishes or drops, the subsequent occupation would quickly set off.

Check the two positions are finished. Likewise, note work 2 started soon after work 1 contended.

16

So in the future assuming somebody gripes that he is getting a blunder “Occupation doesn’t exist or doesn’t have status ‘booked’/delivered’”, you know precisely how to direct him. Blissful Sharing and Learning.

Thank you kindly for your time!!

YOU MAY LIKE THIS

SAP ABAP future in next coming years

Oracle VM Virtualbox Windows 11

ABAP Test Cockpit(ATC) – Introduction and Steps

SAP

Maths in ABAP

Yes! Maths in ABAP. Being a Designing understudy, I’m bit leaned towards Math. A couple of months prior when I needed to compose a program to figure out indivisible numbers, I felt the need of ABAP order which can give me leftover portion (something like % in C). At long last I discovered it and here are a few gatherings of such ABAP orders. Maths in ABAP .

Tracking down the outright worth of a number: |a| – > ABS( a ).
Finding the least number more prominent than a: CEIL( a ).
Finding the best whole number under a: Story( a ).
For mathematical operands, attempt ACOS, COS, and so on
Tracking down the square base of a, a > 0: SQRT( a )
Tracking down the length of characters in the string: STRLEN( a )
Finding leftover portion a/b: a MOD b.

To eliminate characters from any string which has the two characters and numbers then there is a simple stunt.

Assume, you have a string like 12wer34op. Take a variable which is type NUMC and relegate string to this variable and you will have just numbers.

Information: v_string TYPE char10,
v_num TYPE num10.

v_string = ’12wer34op’.
v_num = v_string.

Compose: v_num.
Something to think about:
With the clue above, what might be the result v_num. If it’s not too much trouble, compose it at the remark segment before you compose the code in your framework and execute the program. It would be enjoyable. We are certain, you would be stunned with the result.

Assuming you like Maths, you might likewise want to peruse our other post, Do all ABAPers know Fixed Point Number-crunching?

We as a whole realize ABAP is exceptionally basic language and help is available just with a single tick. Still I deal with issues every so often with all the assist with introducing on the net, I feel a fast tip from a companion/partner is more useful. We can assist you with our experience. We can help and together we can learn.

If you have any desire to get such viable issues and goals directly to your inbox, kindly Buy in. We regard your security and view safeguarding it in a serious way.

Much thanks for your time!!

YOU MAY BE INTERESTED IN

SAP HANA Consultant Cost, Fees, And Job

Mastering OData Query Examples with Ease

SAP training and certification Opportunities

SAP

Create & Change Variants without Fire Fighter

On occasion, you really want to make or alter the program variations straightforwardly Underway framework. Generally the variations are moved in transports and that is the correct way. In any case, certain clients permit you to straightforwardly make variations underway framework. Create & Change Variants without Fire Fighter. 

The difficulty is, you don’t approach SE38, SA38, SE80 or variation t-code underway framework to make/change variations. You really want to sign in utilizing your Fireman id. For those youths who have never worked in any help project, Fireman is a client id which plays raised part. You have honor to that large number of exchanges which you don’t approach with your typical client id. Yet, remember, the Fireman is checked id. Each snap of yours is followed and you should be extremely cautious while utilizing it.

Making/changing the variation through Fireman id isn’t so excruciating, yet recently I have been refreshing/changing the variations without utilizing Fireman job and furthermore not by means of SE38/SA38/SE80.

This may be exceptionally normal practice, yet since I learnt it (coincidentally) so late in my vocation, consequently considered sharing it. There may be somebody like me who doesn’t know about this strategy and would see the value in this.

You can also read for :- Simple SAP Security Breach

The presumption here is, you approach bunch work planning and show t-code SM37. Let’s start with Create & Change Variants without Fire Fighter.

Check I don’t approach SE38.

SAP Variant

Go to SM37. Look for a task which is now planned or running in your framework for the program for which you need to make/change/update the variation.

Fire Fighter

Check we secured three positions for our program.

sapyard

Pick one of the gig and hit Step button.

5

Keep the cursor on the program name, click GoTo menu and Keep up with Variations.

SAPYard

Check you are in ABAP: Variants Screen.

7

You can change, show and make variations here. Be that as it may, kindly take additional wariness. You want to understand what you are doing and you ought to have the legitimate necessities and endorsements for the change as well as make. 

YOU MAY LIKE THIS

Mastering OData Query Syntax in Power Automate

2023 Vision: Discover the SAP Jobs with High Earning Potential and Bright Futures

A step-by-step guide to landing your first SAP MM fresher job

× How can I help you?