Monday, 21 November 2016
Sunday, 9 October 2016
Saturday, 8 October 2016
Friday, 30 September 2016
Thursday, 29 September 2016
Friday, 23 September 2016
Wednesday, 21 September 2016
Tuesday, 20 September 2016
Sunday, 4 September 2016
Instance Operator- NEW(Part 2)
Please check the link: Instance Operator- NEW(Part 2)
------------------------------------------------------------------------------------------------------------------------------------------------
Instance Operator- NEW(Part 1)
Please check the link: Instance Operator- NEW(Part 1)
---------------------------------------------------------------------------------------------------------------------------------------------
Mesh in ABAP- Forward & Inverse Association
Please check the link: Mesh in ABAP- Forward & Inverse Association
-----------------------------------------------------------------------------------------------------------------------------------------------
Mesh- in ABAP
Please check the link: Mesh- in ABAP
--------------------------------------------------------------------------------------------------------------------------------------------
Sunday, 26 June 2016
How to Know Material Info easily!
Many times we create material master by referring to another already created material. We need to know what is the industry sector and material type in Tx- MM01.
Go to Tx- MM03 and provide the already created material that you want to refer to create a new material.
Choose Basic Data 1.
Select the marked [ i ] icon.
It displays the industry sector and the material type of the material. You can easily know this without going back to the DB tables and checking the details.
----------------------------------------------------------------------------------------------------------------------------------------
Dynamic call to FM with PARAMETER-TABLE
The below post shows how to call a FM dynamically and passing all the parameters by using PARAMETER-TABLE option.
We have the below FM with parameters in different sections such as import, export, tables.
The source code returns a table of records from SFLIGHT table if the selection criteria meets else sends back only a text message.
PRORGAM
TYPE-POOLS: abap.
DATA: fm_name TYPE rs38l_fnam VALUE ‘FLIGHT_DETAILS’,
lt_param TYPE abap_func_parmbind_tab,
ls_param TYPE abap_func_parmbind,
lv_msg TYPE string,
lt_flight TYPE TABLE OF sflight.
FIELD-SYMBOLS: <fs_msg> TYPE string,
<fs_details> TYPE ANY TABLE.
PARAMETERS: p_carr TYPE sflight–carrid,
p_conn TYPE sflight–connid,
p_date TYPE sflight–fldate.
* Build parameters
ls_param–name = ‘CARRID’.
ls_param–kind = abap_func_exporting.
GET REFERENCE OF p_carr INTO ls_param–value.
APPEND ls_param TO lt_param.
CLEAR ls_param.
ls_param–name = ‘CONNID’.
ls_param–kind = abap_func_exporting.
GET REFERENCE OF p_conn INTO ls_param–value.
APPEND ls_param TO lt_param.
CLEAR ls_param.
ls_param–kind = abap_func_exporting.
GET REFERENCE OF p_conn INTO ls_param–value.
APPEND ls_param TO lt_param.
CLEAR ls_param.
ls_param–name = ‘FLDATE’.
ls_param–kind = abap_func_exporting.
GET REFERENCE OF p_date INTO ls_param–value.
APPEND ls_param TO lt_param.
CLEAR ls_param.
ls_param–kind = abap_func_exporting.
GET REFERENCE OF p_date INTO ls_param–value.
APPEND ls_param TO lt_param.
CLEAR ls_param.
ls_param–name = ‘MSG’.
ls_param–kind = abap_func_importing.
GET REFERENCE OF lv_msg INTO ls_param–value.
APPEND ls_param TO lt_param.
CLEAR ls_param.
ls_param–kind = abap_func_importing.
GET REFERENCE OF lv_msg INTO ls_param–value.
APPEND ls_param TO lt_param.
CLEAR ls_param.
ls_param–name = ‘DETAILS’.
ls_param–kind = abap_func_tables.
GET REFERENCE OF lt_flight INTO ls_param–value.
APPEND ls_param TO lt_param.
CLEAR ls_param.
ls_param–kind = abap_func_tables.
GET REFERENCE OF lt_flight INTO ls_param–value.
APPEND ls_param TO lt_param.
CLEAR ls_param.
* Dynamic FM call with all import,export,table parameters
* passed in the Parameter-table
CALL FUNCTION fm_name
PARAMETER–TABLE lt_param.
* passed in the Parameter-table
CALL FUNCTION fm_name
PARAMETER–TABLE lt_param.
READ TABLE lt_param INTO ls_param WITH KEY name = ‘MSG’.
IF sy–subrc IS INITIAL.
ASSIGN ls_param–value->* TO <fs_msg>.
IF <fs_msg> IS ASSIGNED AND <fs_msg> IS NOT INITIAL.
WRITE:/ <fs_msg>.
ELSE.
READ TABLE lt_param INTO ls_param WITH KEY name = ‘DETAILS’.
IF sy–subrc IS INITIAL.
ASSIGN ls_param–value->* TO <fs_details>.
IF <fs_details> IS ASSIGNED AND <fs_details> IS NOT INITIAL .
lt_flight = <fs_details>.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy–repid
i_structure_name = ‘SFLIGHT’
TABLES
t_outtab = lt_flight.
IF sy–subrc IS INITIAL.
ASSIGN ls_param–value->* TO <fs_msg>.
IF <fs_msg> IS ASSIGNED AND <fs_msg> IS NOT INITIAL.
WRITE:/ <fs_msg>.
ELSE.
READ TABLE lt_param INTO ls_param WITH KEY name = ‘DETAILS’.
IF sy–subrc IS INITIAL.
ASSIGN ls_param–value->* TO <fs_details>.
IF <fs_details> IS ASSIGNED AND <fs_details> IS NOT INITIAL .
lt_flight = <fs_details>.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy–repid
i_structure_name = ‘SFLIGHT’
TABLES
t_outtab = lt_flight.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
RUN & OUTPUT- For the selection criteria no data is present in SFLIGHT table.
RUN & OUTPUT- For the selection criteria data is present in SFLIGHT table.
Needed Info defined in TYPE GROUP- ABAP
-------------------------------------------------------------------------------------------------------------------------------------------
Subscribe to:
Posts (Atom)