Monday, July 30, 2018

ODP Errors and Solutions

Error when activating 2LIS_18_I0NOTIF
Field AUSZT1 ( Position 4 ): Reference to currency field/unit field SUNIT is obsolete
Field SUMDLZT ( Position 17 ): Reference to currency field/unit field EHTAG is obsolete
Not sure why the erroring is happening or the right solution. Removed the Currency fields references SUNIT and EHTAG  from the fields and activated. Went fine.

Wednesday, July 25, 2018

Events and Interrupts

Event 
You can create and event in SM64.

Using Parameter for an event
??


Raising an Event
There are various ways of raising an event.

1) Raise it directly in SM64.

2) Run it through Standard Program

3) Use an FM to raise it

Transporting an Event
Create a transport request.
Start the editor in the transport request and enter the following:
R3TR TABU <table name> where table name is BTCSEV for a system event ID, BTCUEV for a user event ID.
Press F2 with the cursor on the table name to call up the screen for specifying the table entries to transport. In this screen, enter the event ID’s that you have created.
Save and release the transport request. Ensure that it is imported into your production system(s).

SAP Link : Click HERE

Wednesday, July 18, 2018

ABAP Data Declarations

Declaring Range Tables
Using the data element you are looking for
DATA : lt_bsart    TYPE RANGE OF ESART,
       lw_bsart    LIKE LINE OF lt_bsart,

Declare your internal table type : RSSDLRANGE
  l_t_range-sign   = 'I'.
  l_t_range-option = 'BT'.
  l_t_range-low    = zlow_value.
  l_t_range-high   = zhigh_value
 Append l_t_range TO l_t_range

SIGN values       "I" Include
                   "E" Exclude
OPTION values "EQ" Equal To
                           "BT" Between
                           "CP" Contains Pattern

STATICS
Variables/table declared with STATICS act like Global variables.

ABAP Submit Program Options

Submit program can be used to run one ABAP program from another one. There are different options on how to use a submit Program.

Calling a submit program , with out actually showing the selection screen of the called program

SUBMIT <program_name>  WITH p_paramter/s_option = lv_single_value
                                               WITH p_version = lv_value
                                               AND RETURN.

SUBMIT RSBKDTPDELETE WITH p_dtp = lv_dtp
                                                  AND RETURN.

Calling a submit program and showing the selection screen of the called program.

SUBMIT RSBKDTPDELETE WITH p_dtp = s_dtp-low                                                                                                                          VIA SELECTION-SCREEN AND RETURN.

Calling a submit program and reading the output of the submitted program to a table 
Running the program from single value. For multiple values, run the code in a loop. ( not sure how to pass internal table to selection screen)

DATA                       :  lr_data   TYPE REF TO data.
FIELD-SYMBOLS  : <lt_data> TYPE ANY TABLE ,
                                   <lw_data> TYPE ANY.
custom declarations
DATA : lt_output TYPE STANDARD TABLE OF ztest_table,
              lw_output TYPE ztest_table.

*& Setting up runtime info
cl_salv_bs_runtime_info=>set(    EXPORTING display  = abap_false
                                                                             metadata = abap_false
                                                                            data     = abap_true ).
*& Submit program
SUBMIT RSBKDTPDELETE WITH p_dtp = lv_dtp AND RETURN.

*& Read the data from other program to here
TRY.
    cl_salv_bs_runtime_info=>get_data_ref( IMPORTING r_data = lr_data ).
    ASSIGN lr_data->* TO <lt_data>.
  CATCH cx_salv_bs_sc_runtime_info.
    MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
ENDTRY.
cl_salv_bs_runtime_info=>clear_all( ).

*& Move the output from other program to current program
LOOP AT <lt_data> ASSIGNING  <lw_data>.
MOVE-CORRESPONDING  <lw_data> TO lw_output
APPEND lw_output to lt_output.
ENDLOOP.