Posts

Showing posts from July, 2015

BEGRU Update using BAPI

CASE wmara-mtart. *  WHEN 'Y910'. * *  Fetch all construction id corresponding to design id *  *      SELECT matnr BEGRU FROM mara INTO TABLE lt_mara *                                   WHERE yydesign = wmara *                                     and mtart = 'Z109'. *   IF lt_mara IS NOT INITIAL. * * Loop at lt_mara into ls_mara.       If  ls_mara-begru EQ wmara-begru .  Continue. *     Else. *    " Assigning the current/changed Authorization group *    ls_headdata-material    = ls_mara-matnr ...

REUSE_ALV_COMMENTARY_WRITE

DATA: l_date(10).   DATA: l_header_h TYPE slis_listheader.   DATA: pt_comment TYPE slis_t_listheader.   WRITE sy-datum TO l_date DD/MM/YYYY.   l_header_h-typ  = 'H'.   l_header_h-info = text-100.   APPEND l_header_h TO pt_comment.   l_header_h-typ  = 'H'.   CONCATENATE text-300 a_udate INTO   l_header_h-info SEPARATED BY space.   APPEND l_header_h TO pt_comment.   l_header_h-typ  = 'H'.   CONCATENATE text-200 a_werks INTO   l_header_h-info SEPARATED BY space.   APPEND l_header_h TO pt_comment. * Report header with Date   l_header_h-typ = 'S'.   l_header_h-key = 'Date:'.                        "#EC NOTEXT dk8thost   l_header_h-info = l_date.   APPEND l_header_h TO pt_comment.   CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'     EXPORTING  ...

POPUP_TO_CONFIRM

AT Selection-screen.  DATA ok_code type sy-ucomm.       ok_code = sy-ucomm. If ok_code = 'ONLI'. CALL FUNCTION 'POPUP_TO_CONFIRM'         EXPORTING           TITLEBAR              = TEXT-095           TEXT_QUESTION         = TEXT-096     " Performance-related text message           TEXT_BUTTON_1         = TEXT-097     " CONTINUE           TEXT_BUTTON_2         = TEXT-098     " CANCEL           DEFAULT_BUTTON        = '2' ...

LVC_VARIANT_DEFAULT_GET

FORM variant_default USING l_variant LIKE g_variant-variant.   CLEAR g_variant.   g_variant-report     = sy-repid.   g_variant-username   = sy-uname.   g_variant_save = 'A'.   CALL FUNCTION 'LVC_VARIANT_DEFAULT_GET'     EXPORTING       i_save        = g_variant_save     CHANGING       cs_variant    = g_variant     EXCEPTIONS       wrong_input   = 1       not_found     = 2       program_error = 3       OTHERS        = 4.   IF sy-subrc = 0.     l_variant = g_variant-variant.   ENDIF. ENDFORM.

Populating Deep structure

*Material Type is Y950   ls_attributes-im_name = 'MTART'.   ls_text-sign = 'I'.   ls_text-option = 'EQ'.   ls_text-low = 'Y950'.   APPEND ls_text TO li_text.   CLEAR ls_text.   ls_attributes-im_values = li_text.   APPEND ls_attributes TO li_attributes.   CLEAR ls_attributes.   REFRESH li_text. li_attributes is deep structure has component im_name and other component im_values. im_values is a table.

Modify screen in Module Pool

to modify screen in module pool loop.     module set_screen_0200.  endloop. * module Set_screen_0200 output. * break dkhansen.   add 1 to g_index.   loop at screen.     case screen-name.       when 'GI_WORK_LIKP-EAN_UPC'.         if not GI_WORK_LIKP-EAN_UPC is initial.           screen-input = '0'.         endif.     endcase. *     read table gi_work_likp index g_index.     modify screen.   endloop. endmodule.

Difference between Imlicit and Explicit enhancement

<b>Implecit enhancement :</b> These are provided in specific areas of standard source code: 1. At the end of the programs ( reports, includes, function pools, module pools) 2. At the begin and end of subroutine forms. 3. At the end of the functional module 4. At the end of all visabilities areas In this case you do not need to create and enhancment spot. You directly put your curosr on the enhancement option and create your inplementations by right click. <b>Explicit enhancement :</b> It can be anywhere in your source code. You need to explicitly have a enhancement point.It is of two types: 1. Enhancement spot : It is the point where you can add your code. It can have multiple implementations. All the implementations can active at a time but the sequince of executions of the implementations can be anything. 2. enhancement section : If you want to execute your own code instead of some portion standard code. Only the active implementation i...