Posts

Showing posts from May, 2019

Pop to confirm

Below simple Code to to popup_to_confirm before taking any action you want to any type action to user you can give popum_to_confirm behalf of action you can write your logic and get desired result REPORT   ztest_pop . DATA :  zz_answer . CALL  FUNCTION  'POPUP_TO_CONFIRM'    EXPORTING      titlebar               =  'Warning Message'     text_question          =  'Confirm to Delete?'     text_button_1          =  'Yes'     text_button_2          =  'No'     default_button         =  '2'     display_cancel_button  =  ''    IMPORTING     answer                 =  zz_answer    EXCEPTIONS     text_not_found         =  1      OTHERS                 =  2 . CASE  zz_answer .    WHEN  '1' . *              Process further checks    WHEN  '2' .      SET  SCREEN  0 .      LEAVE  TO   SCREEN  4001 .    WHEN  OTHERS . *              N/a ENDCASE .

TOP OF PAGE

To display top page some time requirement to display top of page for this purpose we have to write below code to display top of page as per user requirement FORM  f_top_of_page2 .                                          "#EC CALLED    REFRESH  gt_header . * Populate header data   gs_header - typ  =  'H' .  "H/S/A->" H = Header, S = Selection, A = Action      CONCATENATE  'Customer Aging as on'  ' '  s_date1 - low+6 ( 2 )  '-'  s_date1 - low+4 ( 2 )  '-'  s_date1 - low+0 ( 4 )  INTO  gs_header - key  RESPECTING BLANKS .     CONCATENATE  'Customer Aging as on'   ' '  s_date1 - low+6 ( 2 )  '-'  s_date1 - low+4 ( 2 )  '-'  s_date1 - low+0 ( 4 )  INTO  gs_header - info  RESPECTING BLANKS . *   WRITE: 'Customer Aging as on', s_date1-low to gs_header-key. *  WRITE: 'Customer Aging as on',  s_date1-low to gs_header-info. *  gs_header-key = 'Customer Aging as on'.

Calling FB03 from Document Number

Some Time Requirement to call t-code using FB03  FORM  f_user_command2  USING  r_ucomm  LIKE  sy - ucomm                         rs_selfield  TYPE  slis_selfield .    CASE  r_ucomm .      WHEN  '&IC1' .       gt_bsid2  =  gt_bsid .        READ  TABLE  gt_bsid1  INTO  gs_bsid1  INDEX  rs_selfield - tabindex .          SET  PARAMETER  ID  'BLN'  FIELD  gs_bsid1 - belnr .          SET  PARAMETER  ID  'BUK'  FIELD  gs_bsid1 - BUKRS .          SET  PARAMETER  ID  'GJR'  FIELD  gs_bsid1 - GJAHR .          CALL  TRANSACTION  'FB03'  AND  SKIP  FIRST  SCREEN  . ENDCASE . ENDFORM . 

Select Option Restrict Value Showing single value at select option

Requirement to display single value in select option for this purpose we have to use below function Module.    TYPE-POOLS  sccr .    DATA  restrict  TYPE  sscr_restrict .    DATA  optlist  TYPE  sscr_opt_list .    DATA  ass  TYPE  sscr_ass .   optlist - name  =  'OBJECTKEY1' .   optlist - options - eq  =  'X' .    APPEND  optlist  TO  restrict - opt_list_tab .   ass - kind  =  'S' .   ass - name  =  'S_ERATE' .   ass - sg_main  =  'I' .   ass - op_main  =  'OBJECTKEY1' .    APPEND  ass  TO  restrict - ass_tab .    CALL  FUNCTION  'SELECT_OPTIONS_RESTRICT'      EXPORTING        program                 =  sy - cprog       restriction             =  restrict       db                      =  space      EXCEPTIONS       too_late                =  1       repeated                =  2       selopt_without_options  =  3       selopt_without_signs    =  4       invalid_sign            =  5       empty_option_

List Box Example In sap ABAP programming

Simple Example to getting list box example  REPORT   ZTEST_R . TYPE-POOLS :  vrm . DATA :  gt_list      TYPE  vrm_values . DATA :  gwa_list     TYPE  vrm_value . DATA :  gt_values    TYPE  TABLE  OF  dynpread ,       gwa_values   TYPE  dynpread . DATA :  gv_selected_value ( 10 )  TYPE  c . *--------------------------------------------------------------* *Selection-Screen *--------------------------------------------------------------* PARAMETERS :  list  TYPE  c  AS  LISTBOX VISIBLE LENGTH  20 . *--------------------------------------------------------------* *At Selection Screen *--------------------------------------------------------------* AT  SELECTION-SCREEN  ON  list .    CLEAR :  gwa_values ,  gt_values .    REFRESH  gt_values .   gwa_values - fieldname  =  'LIST' .    APPEND  gwa_values  TO  gt_values .    CALL  FUNCTION  'DYNP_VALUES_READ'      EXPORTING       dyname              =  sy - cprog       dynumb              =  sy - dyn

Value Request For throw Program

Table Value Request     with help of values request you can find out the values  DATA :  it_search  TYPE  TABLE  OF  zcs_invoice ,       it_return  TYPE  TABLE  OF  ddshretval ,       wa_return  TYPE  ddshretval . RANGES :  r_user  FOR  pnwtyh - creaby . SELECTION-SCREEN  ON  VALUE-REQUEST  FOR  s_inv - low .    CALL  FUNCTION  'F4IF_INT_TABLE_VALUE_REQUEST'      EXPORTING *     DDIC_STRUCTURE  = 'EKKO'       retfield         =  'ZZINV'       dynprofield      =  'S_INV-LOW'       window_title     =  'INVOICE'       value_org        =  'S'      TABLES       value_tab        =  it_search       return_tab       =  it_return      EXCEPTIONS       parameter_error  =  1       no_values_found  =  2        OTHERS           =  3 .    READ  TABLE  it_return  INTO  wa_return  INDEX  1 .   s_inv - low  =  wa_return - fieldval .