Prob in Report output through Module Pool

Hi,
I have developed Module Pool and in tht screen 100 , in PAI under fcode 'APPEND' i am appending record into the itab.
while user press 'VIEW' it will execute f-code VIEW and display records of itab as a report output.
now on the report output, for each records i have CHECKBOX ,while they press DELETE button on application toolbar, marked checkbox details should get deleted from report output.
But my problem is while i am press DELETE button in report output it is not calling screen 100 PAI or PBO .then how will i delete records , can anybody suggest me ?
Thanks.

Are you able to see the Delete Button, If so then it Definitely comes to AT USER-COMMAND.
WHEN 'VCART'.
LEAVE TO LIST-PROCESSING.
SET PF-STATUS 'LIST'.   "This is for List status here you set the Delete button backbutton
loop at i_cart.
WRITE:/01(01) '|', I_CART-CHECK AS CHECKBOX,05(01) '|',
06(40) I_CART-CMAKTX,46(01) '|',
47(30) I_CART-LENGTH,77(01) '|',
78(07) I_CART-CHNG_QTY,85(01) '|',
86(03) WS_UOM,89(01) '|',
90(10) I_CART-LENGTH_LIN,100(01) '|',
101(07) WS_P1,108(01) '|'.
WRITE:/01(108) SY-ULINE.
endloop.
AT USER-COMMAND.
case sy-ucomm.
WHEN 'DELETE'.
" Here you need to delete the record.
"if you want to go back
LEAVE LIST PROCESSING.
"then you will go to main screen,
endcase.
try this approach..

Similar Messages

  • Data insert through module pool programming

    hi
    I want to insert the data  into the data base through module pool programming.I am taking the fields from different tables, I need sample code ,please help me

    Hi Dhanunjay,
    REPORT zpe_str_le .
    TABLES : zpe_str , zprd_mis1 , mseg , t001l.
    *DATA : STR TYPE C VALUE '50'.
    data : text(100) VALUE 'DELETED STORAGE LOCATION NO '.
    SELECTION-SCREEN : BEGIN OF SCREEN 123 AS WINDOW TITLE TEXT-005.
    SELECT-OPTIONS : S_ZSLOC FOR ZPE_STR-ZSLOC,
    S_ZMACD FOR ZPE_STR-ZMACD,
    S_ZPGRP FOR ZPE_STR-ZPGRP.
    SELECTION-SCREEN : END OF SCREEN 123.
    DATA : flag(1) TYPE c,
    flag1 TYPE c ,
    flag3 TYPE c VALUE '1'.
    DATA : etab LIKE t001l OCCURS 0 WITH HEADER LINE.
    SELECT * FROM T001L INTO TABLE ETAB.
    DATA : ihead LIKE thead.
    DATA : prevtab LIKE tline OCCURS 0 WITH HEADER LINE.
    data : Jtab like TLINE occurs 0 with header line.
    DATA : jtab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : itab LIKE zprd_mis1 OCCURS 0 WITH HEADER LINE.
    *SELECT * FROM zprd_mis1 INTO TABLE itab.
    DATA : BEGIN OF itab_sloc OCCURS 0,
    werks LIKE t001l-werks,
    lgort LIKE t001l-lgort,
    lgobe LIKE t001l-lgobe,
    END OF itab_sloc.
    *FLAG = 0.
    CALL SCREEN 100.
    MODULE user_command_0100 INPUT.
    CASE sy-ucomm.
    WHEN 'RET'.
    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 100.
    *PERFORM PREVIEW.
    LOOP AT prevtab.
    WRITE : / prevtab.
    ENDLOOP.
    LOOP AT JTAB[] INTO ZPRD_MIS1.
    WRITE : Jtab-TDFORMAT.
    WRITE : Jtab-TDLINE .
    *********ZPRD_MIS1-MANDT = Jtab-TDLINE .
    *********ZPRD_MIS1-SLOC = Jtab-TDLINE .
    *********ZPRD_MIS1-MCODE = Jtab-TDLINE .
    *********ZPRD_MIS1-GCODE = Jtab-TDLINE .
    *********ZPRD_MIS1-DESCR = Jtab-TDLINE .
    *********INSERT ZPRD_MIS1.
    ENDLOOP.
    WRITE : JTAB-ZSLOC.
    *********CALL TRANSACTION 'SO10'.
    SET CURSOR 2 2.
    WHEN 'DET'.
    SELECT * FROM ZPRD_MIS1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
    CALL SCREEN 123 STARTING AT 10 5.
    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
    SKIP 2 .
    WRITE :/1(8) 'STR.LOC' ,10(15) 'MRP. CTLR',27(10) 'P.GRP' ,39(40) 'DESCRIPTION OF PRODUCT'.
    SELECT SLOC MCODE GCODE DESCR FROM zprd_mis1 INTO ZPRD_MIS1 WHERE SLOC IN S_ZSLOC AND
    MCODE IN S_ZMACD AND
    GCODE IN S_ZPGRP.
    WRITE :/1(8) zprd_mis1-SLOC ,10(15) zprd_mis1-MCODE ,27(10) zprd_mis1-GCODE ,39(40) zprd_mis1-DESCR .
    ENDSELECT.
    WHEN 'CLEAR'.
    flag = 4.
    IF zpe_str-zsloc NE ' '.
    CLEAR zpe_str.
    ELSE.
    MESSAGE 'ALREADY CLEARED' TYPE 'S'.
    ENDIF.
    WHEN 'EXIT'.
    LEAVE TO SCREEN 0.
    WHEN 'SAVE'.
    IF zpe_str-zdesc NE ' '.
    IF zpe_str-zsloc NE ' '.
    LOOP AT itab.
    READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
    IF sy-subrc = 0 AND flag = 5.
    zprd_mis1-mandt = sy-mandt.
    zprd_mis1-sloc = zpe_str-zsloc .
    zprd_mis1-mcode = zpe_str-zmacd .
    zprd_mis1-gcode = zpe_str-zpgrp.
    zprd_mis1-descr = zpe_str-zdesc .
    MODIFY zprd_mis1.
    flag1 = 7.
    MESSAGE 'STORAGE LOCATION MODIFIED' TYPE 'S'.
    EXIT.
    ELSE.
    zprd_mis1-mandt = sy-mandt.
    zprd_mis1-sloc = zpe_str-zsloc .
    zprd_mis1-mcode = zpe_str-zmacd .
    zprd_mis1-gcode = zpe_str-zpgrp.
    zprd_mis1-descr = zpe_str-zdesc .
    INSERT zprd_mis1.
    APPEND itab.
    flag = 5.
    flag1 = 7.
    MESSAGE 'STORAGE LOCATION CREATED' TYPE 'S'.
    *MESSAGE 'DATA ALREADY SAVED' TYPE 'S'.
    EXIT.
    *ENDIF.
    ENDIF.
    ENDLOOP.
    ELSE.
    flag = 3.
    MESSAGE 'PLEASE ENTER THE STORAGE LOCATION' TYPE 'S'.
    ENDIF.
    ELSE.
    LOOP AT itab.
    READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
    IF sy-subrc = 0.
    MESSAGE 'ALREADY SAVED' TYPE 'S'.
    ELSE.
    MESSAGE 'ENTRIES FOR OTHER FIELDS REQUIRED' TYPE 'S'.
    ENDIF.
    ENDLOOP.
    ENDIF.
    WHEN 'CHECK'.
    SELECT * FROM zprd_mis1 INTO TABLE itab.
    IF zpe_str-zsloc NE ' '.
    LOOP AT itab.
    READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
    IF sy-subrc = 0.
    zpe_str-zmandt = itab-mandt.
    zpe_str-zsloc = itab-sloc.
    zpe_str-zmacd = itab-mcode.
    zpe_str-zpgrp = itab-gcode.
    zpe_str-zdesc = itab-descr.
    flag = 7.
    flag1 = 7.
    ELSE.
    MESSAGE 'NO SUCH STORAGE LOCATION AVAILABLE' TYPE 'S'.
    EXIT.
    ENDIF.
    ENDLOOP.
    ELSE.
    flag = 3.
    MESSAGE 'PLEASE ENTER THE STORAGE LOCATION' TYPE 'S'.
    EXIT.
    ENDIF.
    WHEN 'DELETE'.
    IF zpe_str-zsloc EQ ' '.
    flag = 3.
    MESSAGE 'NOSUCH LOCATION AVAILABLE' TYPE 'S'.
    ELSE.
    READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
    IF sy-subrc = 0.
    zpe_str-zmandt = itab-mandt.
    zpe_str-zsloc = itab-sloc.
    zpe_str-zmacd = itab-mcode.
    zpe_str-zpgrp = itab-gcode.
    zpe_str-zdesc = itab-descr.
    IF zpe_str-zsloc NE ' '.
    CALL FUNCTION 'G_CHECK_PASSWORD'
    EXPORTING
    password = 'PLANT1'
    EXCEPTIONS
    not_authorized = 1
    canceled = 2
    OTHERS = 3.
    IF sy-subrc = 0.
    PERFORM PREVIEW.
    DELETE FROM zprd_mis1 WHERE SLOC = zpe_str-zSLOC.
    UPDATE zprd_mis1.
    APPEND itab.
    MESSAGE 'STORAGE LOCATION DELETED' TYPE 'S'.
    ELSEIF SY-SUBRC = 2.
    MESSAGE 'OPRATION CANCELLED' TYPE 'E'.
    ELSEIF SY-SUBRC = 3.
    MESSAGE 'UNAUTHORIZED' TYPE 'E'.
    ENDIF.
    ELSE.
    MESSAGE 'STORAGE LOCATION CONTAINS NO DATA' TYPE 'S'.
    ENDIF.
    ELSE.
    MESSAGE 'STORAGE LOCATION CONTAINS NO DATA' TYPE 'S'.
    ENDIF.
    ENDIF.
    WHEN 'CREATE'.
    FLAG3 = 12.
    IF zpe_str-zsloc EQ ' '.
    MESSAGE 'ENTER THE STORAGE LOCATION' TYPE 'S'.
    EXIT.
    ELSE.
    LOOP AT etab.
    READ TABLE etab WITH KEY lgort = zpe_str-zsloc .
    IF sy-subrc = 0.
    read table itab with key sloc = zpe_str-zsloc .
    if sy-subrc = 0.
    zpe_str-zmandt = itab-mandt.
    zpe_str-zsloc = itab-sloc.
    zpe_str-zmacd = itab-mcode.
    zpe_str-zpgrp = itab-gcode.
    zpe_str-zdesc = itab-descr.
    flag = 7.
    flag1 = 7.
    clear flag .
    clear flag1.
    message 'storage location alredy exist' type 'S'.
    ELSE.
    FLAG = 2.
    MESSAGE 'STORAGE LOCATION ENTIRES DOESNOT EXIST' TYPE 'S'.
    ENDIF.
    else.
    message 'no such storage location exist' type 'S'.
    endif.
    endloop.
    FLAG = 2.
    exit.
    endif.
    WHEN 'CHANGE'.
    SELECT * FROM zprd_mis1 INTO TABLE itab.
    IF zpe_str-zsloc NE ' '.
    LOOP AT itab.
    READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
    IF sy-subrc = 0.
    flag = 5.
    flag1 = 6.
    zpe_str-zmandt = itab-mandt.
    zpe_str-zsloc = itab-sloc.
    zpe_str-zmacd = itab-mcode.
    zpe_str-zpgrp = itab-gcode.
    zpe_str-zdesc = itab-descr.
    ELSE.
    MESSAGE 'NO STORAGE LOCATION AVAILABLE' TYPE 'S'.
    ENDIF.
    ENDLOOP.
    ELSE.
    flag = 3.
    MESSAGE 'PLEASE ENTER THE STORAGE LOCATION' TYPE 'S'.
    ENDIF.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module STATUS_0100 OUTPUT
    text
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'AAA'.
    SET TITLEBAR 'aaa'.
    IF flag3 = '1'.
    CALL FUNCTION 'G_CHECK_PASSWORD'
    EXPORTING
    password = 'PLANT1'
    EXCEPTIONS
    not_authorized = 1
    canceled = 2
    OTHERS = 3.
    IF sy-subrc 0.
    MESSAGE 'un authorized' TYPE 'S'(001).
    LEAVE TO SCREEN 0.
    ELSEIF SY-SUBRC = 2.
    MESSAGE ' OPERATION CANCELLED' TYPE 'S'(001).
    LEAVE TO SCREEN 0.
    ELSEIF SY-SUBRC = 3.
    LEAVE TO SCREEN 0.
    MESSAGE 'RESTRICTED' TYPE 'S'(001).
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CLEAR flag3.
    ENDIF.
    SELECT * FROM zprd_mis1 INTO TABLE itab.
    LOOP AT SCREEN.
    IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    IF flag = 5 AND flag1 EQ 6.
    LOOP AT SCREEN.
    IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
    screen-input = 1.
    MODIFY SCREEN.
    ENDIF.
    IF screen-name = 'CREATE' OR screen-name = 'DELETE' OR screen-name = 'CHANGE' OR screen-name = 'CHECK'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    EXIT.
    ENDIF.
    IF flag = 2.
    LOOP AT SCREEN.
    IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
    screen-input = 1.
    MODIFY SCREEN.
    ENDIF.
    IF screen-name = 'CREATE' OR screen-name = 'DELETE' OR screen-name = 'CHANGE' OR screen-name = 'CHECK'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    EXIT.
    ENDIF.
    IF flag3 = 12.
    LOOP AT SCREEN.
    IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
    screen-input = 1.
    MODIFY SCREEN.
    ENDIF.
    IF screen-name = 'CREATE' OR screen-name = 'DELETE' OR screen-name = 'CHANGE' OR screen-name = 'RET' OR screen-name = 'CHECK'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    EXIT.
    CLEAR FLAG3.
    ENDIF.
    IF flag = 4.
    IF screen-name CP 'ZPE_*'.
    screen-input = 1.
    ENDIF.
    ENDIF.
    IF flag1 = 7 AND flag = 5.
    LOOP AT SCREEN.
    IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZSLOC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    IF screen-name = 'CREATE' OR screen-name = 'DELETE' OR screen-name = 'CHECK' OR screen-name = 'SAVE'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF flag1 = 7 AND flag = 7.
    LOOP AT SCREEN.
    IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZSLOC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    IF screen-name = 'CREATE' OR screen-name = 'CHECK' OR screen-name = 'SAVE'." OR screen-name = 'DELETE'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF flag1 = 4 AND flag = 3.
    LOOP AT SCREEN.
    IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZSLOC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    IF screen-name = 'CREATE' OR screen-name = 'SAVE' OR screen-name = 'DELETE' OR screen-name = 'CHANGE' OR screen-name = 'CHECK'.
    screen-input = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    DATA: BEGIN OF r1 OCCURS 1.
    INCLUDE STRUCTURE ddshretval.
    DATA: END OF r1.
    *& Module VALUE_SLOC INPUT
    text
    MODULE value_sloc INPUT.
    SELECT lgort werks lgobe FROM t001l INTO CORRESPONDING FIELDS OF TABLE itab_sloc.
    DELETE ADJACENT DUPLICATES FROM itab_sloc COMPARING lgort.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'LGORT'
    value_org = 'S'
    TABLES
    value_tab = itab_sloc
    return_tab = r1
    EXCEPTIONS
    parameter_error = 1
    no_values_found = 2
    OTHERS = 3.
    IF sy-subrc EQ 0.
    IF r1-fieldval IS NOT INITIAL.
    zpe_str-zsloc = r1-fieldval.
    ENDIF.
    ENDIF.
    EXIT.
    *ENDSELECT.
    ENDMODULE. " VALUE_SLOC INPUT
    FORM PREVIEW.
    *TABLES : ZPE_STR , ZPRD_MIS1 , MSEG.
    data : ihead like thead.
    DATA : prevtab like TLINE occurs 0 with header line.
    data : Jtab like TLINE occurs 0 with header line.
    *data : Jtab like thead occurs 0 with header line.
    *data : text(100).
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    CLIENT = SY-MANDT
    ID = 'ST'
    LANGUAGE = sy-langu
    NAME = 'ZSLDEL'
    OBJECT = 'TEXT'
    ARCHIVE_HANDLE = 0
    LOCAL_CAT = ' '
    IMPORTING
    HEADER =
    TABLES
    LINES = prevtab[]
    EXCEPTIONS
    ID = 1
    LANGUAGE = 2
    NAME = 3
    NOT_FOUND = 4
    OBJECT = 5
    REFERENCE_CHECK = 6
    WRONG_ACCESS_TO_ARCHIVE = 7
    OTHERS = 8
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    if not prevtab[] is initial.
    append lines of prevtab to jtab.
    endif.
    *IHEAD-TDFDATE = SY-DATUM.
    *IHEAD-TDFTIME = SY-UZEIT.
    ihead-TDOBJECT = 'TEXT'.
    ihead-TDNAME = 'ZSLDEL'.
    ihead-TDID = 'ST'.
    ihead-TDSPRAS = sy-langu.
    type-pools : slis.
    Jtab-TDFORMAT = ''.
    *Jtab-TDLINE = 'SLOCATION'.
    *append Jtab.
    *Jtab-TDFORMAT = ''.
    Jtab-TDFORMAT = '*'.
    Jtab-TDLINE = ZPE_STR-ZSLOC.
    append Jtab.
    Jtab-TDFORMAT = ''.
    *Jtab-TDLINE = 'DATE'.
    *append Jtab.
    Jtab-TDFORMAT = ''.
    *Jtab-TDLINE = SY-DATUM.
    *append Jtab.
    Jtab-TDFORMAT = ''.
    *Jtab-TDLINE = 'TIME'.
    *append Jtab.
    Jtab-TDFORMAT = ''.
    *Jtab-TDLINE = SY-UZEIT.
    *Jtab-TDFORMAT = ''.
    *append Jtab.
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
    CLIENT = SY-MANDT
    HEADER = ihead
    INSERT = 'X'
    SAVEMODE_DIRECT = ' '
    OWNER_SPECIFIED = ' '
    LOCAL_CAT = ' '
    IMPORTING
    FUNCTION =
    NEWHEADER =
    TABLES
    LINES = Jtab
    EXCEPTIONS
    ID = 1
    LANGUAGE = 2
    NAME = 3
    OBJECT = 4
    OTHERS = 5
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'COMMIT_TEXT'
    EXPORTING
    OBJECT = '*'
    NAME = '*'
    ID = '*'
    LANGUAGE = '*'
    SAVEMODE_DIRECT = ' '
    KEEP = ' '
    LOCAL_CAT = ' '
    IMPORTING
    COMMIT_COUNT =
    TABLES
    T_OBJECT =
    T_NAME =
    T_ID =
    T_LANGUAGE =
    ENDFORM.
    *&spwizard: declaration of tablecontrol 'TBLECTL' itself
    controls: TBLECTL type tableview using screen 0100.
    *&spwizard: lines of tablecontrol 'TBLECTL'
    data: g_TBLECTL_lines like sy-loopc.
    data: OK_CODE like sy-ucomm.
    *&spwizard: output module for tc 'TBLECTL'. do not change this line!
    *&spwizard: update lines for equivalent scrollbar
    module TBLECTL_change_tc_attr output.
    describe table ITAB lines TBLECTL-lines.
    endmodule.
    *&spwizard: output module for tc 'TBLECTL'. do not change this line!
    *&spwizard: get lines of tablecontrol
    module TBLECTL_get_lines output.
    g_TBLECTL_lines = sy-loopc.
    endmodule.
    *&spwizard: input module for tc 'TBLECTL'. do not change this line!
    *&spwizard: process user command
    module TBLECTL_user_command input.
    OK_CODE = sy-ucomm.
    perform user_ok_tc using 'TBLECTL'
    'ITAB'
    changing OK_CODE.
    sy-ucomm = OK_CODE.
    endmodule.
    INCLUDE TABLECONTROL_FORMS *
    *& Form USER_OK_TC *
    FORM USER_OK_TC USING P_TC_NAME TYPE DYNFNAM
    P_TABLE_NAME
    P_MARK_NAME
    CHANGING P_OK LIKE SY-UCOMM.
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA: L_OK TYPE SY-UCOMM,
    L_OFFSET TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
    *&SPWIZARD: Table control specific operations *
    *&SPWIZARD: evaluate TC name and operations *
    SEARCH P_OK FOR P_TC_NAME.
    IF SY-SUBRC 0.
    EXIT.
    ENDIF.
    L_OFFSET = STRLEN( P_TC_NAME ) + 1.
    L_OK = P_OK+L_OFFSET.
    *&SPWIZARD: execute general and TC specific operations *
    CASE L_OK.
    WHEN 'INSR'. "insert row
    PERFORM FCODE_INSERT_ROW USING P_TC_NAME
    P_TABLE_NAME.
    CLEAR P_OK.
    WHEN 'DELE'. "delete row
    PERFORM FCODE_DELETE_ROW USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME.
    CLEAR P_OK.
    WHEN 'P--' OR "top of list
    'P-' OR "previous page
    'P+' OR "next page
    'P++'. "bottom of list
    PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
    L_OK.
    CLEAR P_OK.
    WHEN 'L--'. "total left
    PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
    WHEN 'L-'. "column left
    PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
    WHEN 'R+'. "column right
    PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
    WHEN 'R++'. "total right
    PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
    WHEN 'MARK'. "mark all filled lines
    PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME .
    CLEAR P_OK.
    WHEN 'DMRK'. "demark all filled lines
    PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME .
    CLEAR P_OK.
    WHEN 'SASCEND' OR
    'SDESCEND'. "sort column
    PERFORM FCODE_SORT_TC USING P_TC_NAME
    l_ok.
    ENDCASE.
    ENDFORM. " USER_OK_TC
    *& Form FCODE_INSERT_ROW *
    FORM fcode_insert_row
    USING P_TC_NAME TYPE DYNFNAM
    P_TABLE_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA L_LINES_NAME LIKE FELD-NAME.
    DATA L_SELLINE LIKE SY-STEPL.
    DATA L_LASTLINE TYPE I.
    DATA L_LINE TYPE I.
    DATA L_TABLE_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
    FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
    FIELD-SYMBOLS <LINES> TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc *
    CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
    ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
    *&SPWIZARD: get looplines of TableControl *
    CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
    ASSIGN (L_LINES_NAME) TO <LINES>.
    *&SPWIZARD: get current line *
    GET CURSOR LINE L_SELLINE.
    if sy-subrc 0. " append line to table
    l_selline = <tc>-lines + 1.
    *&SPWIZARD: set top line *
    if l_selline > <lines>.
    <tc>-top_line = l_selline - <lines> + 1 .
    else.
    <tc>-top_line = 1.
    endif.
    else. " insert line into table
    l_selline = <tc>-top_line + l_selline - 1.
    l_lastline = <tc>-top_line + <lines> - 1.
    endif.
    *&SPWIZARD: set new cursor line *
    l_line = l_selline - <tc>-top_line + 1.
    *&SPWIZARD: insert initial line *
    INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
    <TC>-LINES = <TC>-LINES + 1.
    *&SPWIZARD: set cursor *
    SET CURSOR LINE L_LINE.
    ENDFORM. " FCODE_INSERT_ROW
    *& Form FCODE_DELETE_ROW *
    FORM fcode_delete_row
    USING P_TC_NAME TYPE DYNFNAM
    P_TABLE_NAME
    P_MARK_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA L_TABLE_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE cxtab_control.
    FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
    FIELD-SYMBOLS <WA>.
    FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc *
    CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
    ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
    *&SPWIZARD: delete marked lines *
    DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
    LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header *
    ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
    IF <MARK_FIELD> = 'X'.
    DELETE <TABLE> INDEX SYST-TABIX.
    IF SY-SUBRC = 0.
    <TC>-LINES = <TC>-LINES - 1.
    ENDIF.
    ENDIF.
    ENDLOOP.
    ENDFORM. " FCODE_DELETE_ROW
    *& Form COMPUTE_SCROLLING_IN_TC
    text
    -->P_TC_NAME name of tablecontrol
    -->P_OK ok code
    FORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
    P_OK.
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA L_TC_NEW_TOP_LINE TYPE I.
    DATA L_TC_NAME LIKE FELD-NAME.
    DATA L_TC_LINES_NAME LIKE FELD-NAME.
    DATA L_TC_FIELD_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE cxtab_control.
    FIELD-SYMBOLS <LINES> TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get looplines of TableControl *
    CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
    ASSIGN (L_TC_LINES_NAME) TO <LINES>.
    *&SPWIZARD: is no line filled? *
    IF <TC>-LINES = 0.
    *&SPWIZARD: yes, ... *
    L_TC_NEW_TOP_LINE = 1.
    ELSE.
    *&SPWIZARD: no, ... *
    CALL FUNCTION 'SCROLLING_IN_TABLE'
    EXPORTING
    ENTRY_ACT = <TC>-TOP_LINE
    ENTRY_FROM = 1
    ENTRY_TO = <TC>-LINES
    LAST_PAGE_FULL = 'X'
    LOOPS = <LINES>
    OK_CODE = P_OK
    OVERLAPPING = 'X'
    IMPORTING
    ENTRY_NEW = L_TC_NEW_TOP_LINE
    EXCEPTIONS
    NO_ENTRY_OR_PAGE_ACT = 01
    NO_ENTRY_TO = 02
    NO_OK_CODE_OR_PAGE_GO = 03
    OTHERS = 0.
    ENDIF.
    *&SPWIZARD: get actual tc and column *
    GET CURSOR FIELD L_TC_FIELD_NAME
    AREA L_TC_NAME.
    IF SYST-SUBRC = 0.
    IF L_TC_NAME = P_TC_NAME.
    *&SPWIZARD: et actual column *
    SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
    ENDIF.
    ENDIF.
    *&SPWIZARD: set the new top line *
    <TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
    ENDFORM. " COMPUTE_SCROLLING_IN_TC
    *& Form FCODE_TC_MARK_LINES
    marks all TableControl lines
    -->P_TC_NAME name of tablecontrol
    FORM FCODE_TC_MARK_LINES USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME.
    &SPWIZARD: EGIN OF LOCAL DATA----
    DATA L_TABLE_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE cxtab_control.
    FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
    FIELD-SYMBOLS <WA>.
    FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc *
    CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
    ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
    *&SPWIZARD: mark all filled lines *
    LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header *
    ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
    <MARK_FIELD> = 'X'.
    ENDLOOP.
    ENDFORM. "fcode_tc_mark_lines
    *& Form FCODE_TC_DEMARK_LINES
    demarks all TableControl lines
    -->P_TC_NAME name of tablecontrol
    FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
    P_TABLE_NAME
    P_MARK_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
    DATA L_TABLE_NAME LIKE FELD-NAME.
    FIELD-SYMBOLS <TC> TYPE cxtab_control.
    FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
    FIELD-SYMBOLS <WA>.
    FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
    ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc *
    CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
    ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
    *&SPWIZARD: demark all filled lines *
    LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header *
    ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
    <MARK_FIELD> = SPACE.
    ENDLOOP.
    ENDFORM. "fcode_tc_mark_lines
    Source : https://forums.sdn.sap.com/click.jspa?searchID=15092700&messageID=5654151
    Have A Good Day
    Chaitanya.

  • Find which report invoke my module pool program

    hi everyone,
        I have a problem of finding which report calling my module pool program.
        I have one module pool program and 5 reports. In all 5 reports i use
    call transaction to fill up the screen values of that module pool program.
       Now i have to change screen output depending upon the each report.
    So i have to find out which report call my module pool program
       Is there any possiblity to find out??? my client will not allow to use
    SAP memory or ABAP memory.
    Thanks in advance,
    Florian

    Hi,
    Check this system field. This is for procedures
    sy-cprog - In procedures called externally, the name of the calling program, Otherwise the name of the current program. If a procedure called externally calls another external procedure, sy-cprog contains the name of the framework program, and is not set to the name of the framework program of the subsequent calling program.
    may be this works.

  • HOw to find Report program associated module pool program?

    HOw to find Report program associated module pool program?
    I.e
    Me21n is the tcode.I want to find screens related to this tcode.
    Associated report program is RM_MEPO_GUI.(It has no screens hence it is a report program).
    (if module program is attached to tcode,i can easily find entries in d020s)
    Here  report program is calling a module pool program SAPLMEGUI(Has screens).
    If i give the Tcode Me21n,i want to list out all the screens of it..
    Can u give any suggestion....

    Hi Sampath.
    Manually i can see it (by seeing in system-status)..
    programmatically i want to know..
    for ex:if u take  Tcode:Va01
    we can get program (dialog)  and tcode in Tstc table .
    If we know the program name(dialog), we can find program and screens in d020s table.
    Va01 is atatched to a module pool program..No problem to find screens..
    In case of me21n,
    It is atatched to report program(calling module pool program)..
    Here i could not be able to get the screens ..
    I think u undrstood my problem..

  • How to save Custom control records through module pool program ?

    Hi guru ,
    1. How to save Custom control records through module pool program ?
    I wrote multiple lines of record in custom control
    Who to save that records ?
    thanking you.
    Regards,
    Subash.

    Hi,
    can refer following code -
    IN PAI , CODE is as follows-
    *&      Form  editor_output
    FORM editor_output .
    NARRATION1 is name of custom controller
      IF v_editor IS INITIAL.
      Create obejct for custom container
        CREATE OBJECT v_custom_container
          EXPORTING
            container_name              = 'NARRATION1'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      Create obejct for the TextEditor control
        CREATE OBJECT v_editor
          EXPORTING
            wordwrap_mode              = cl_gui_textedit=>wordwrap_at_fixed_position
            wordwrap_position          = line_length
            wordwrap_to_linebreak_mode = cl_gui_textedit=>true
            parent                     = v_custom_container
          EXCEPTIONS
            error_cntl_create          = 1
            error_cntl_init            = 2
            error_cntl_link            = 3
            error_dp_create            = 4
            gui_type_not_supported     = 5
            OTHERS                     = 6.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
    ENDFORM.                    " editor_output
    getting textdata in internal table as follows
    *&      Form  create_text
    FORM create_text .
      REFRESH : it_texttable,
                it_text.
      IF v_doc_number IS NOT INITIAL.
        IF v_editor IS NOT INITIAL.
          CALL METHOD v_editor->get_text_as_r3table
            IMPORTING
              table                  = it_texttable
            EXCEPTIONS
              error_dp               = 1
              error_cntl_call_method = 2
              error_dp_create        = 3
              potential_data_loss    = 4
              OTHERS                 = 5.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                       WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    Now, our final text data is in internal table it_texttable.
    pls, Reward if found helpful.

  • Implement report through module pool(by se38).......

    Please provide me the steps to implement a report through a module pool(by se38).................
    Thanks and Regards
    Suman Karmakar
    Edited by: suman.career08 on May 27, 2011 10:13 AM
    Moderator Message: Please search for available information. Thread Locked.
    Edited by: kishan P on May 27, 2011 1:44 PM

    Are you able to see the Delete Button, If so then it Definitely comes to AT USER-COMMAND.
    WHEN 'VCART'.
    LEAVE TO LIST-PROCESSING.
    SET PF-STATUS 'LIST'.   "This is for List status here you set the Delete button backbutton
    loop at i_cart.
    WRITE:/01(01) '|', I_CART-CHECK AS CHECKBOX,05(01) '|',
    06(40) I_CART-CMAKTX,46(01) '|',
    47(30) I_CART-LENGTH,77(01) '|',
    78(07) I_CART-CHNG_QTY,85(01) '|',
    86(03) WS_UOM,89(01) '|',
    90(10) I_CART-LENGTH_LIN,100(01) '|',
    101(07) WS_P1,108(01) '|'.
    WRITE:/01(108) SY-ULINE.
    endloop.
    AT USER-COMMAND.
    case sy-ucomm.
    WHEN 'DELETE'.
    " Here you need to delete the record.
    "if you want to go back
    LEAVE LIST PROCESSING.
    "then you will go to main screen,
    endcase.
    try this approach..

  • Printing ALV Report output through Function Modules

    Hi All,
    I want to print my ALV Grid output through function modules/statement (not through print option in menu).
    This is because, i am generating a PDF from spool when user clicks on a button. If any changes happened in the ALV output layout, they will be captured in spool through printing it.
    So can you please tell me how to print the ALV Output through FMs or sending the ALV output to spool.
    Thanks & Regards,
    Senthil.
    Edited by: senthil nathan on May 17, 2010 2:49 PM

    Hi Dev,
    Thanks for the reply.
    I want to print the ALV when the user clicks on a button in toolbar. Lets say the user has made some changes to the layout, (E.g hiding a field) and when i print that output it should use the changed layout, If i use the FM suggested by you, i cant acheive this.
    If you try to print this manually, the system uses the changed layout and not the original. Thats why i want to know FMs/statement to print.
    Regards,
    Senthil.

  • How to send ALV report Output through mail in background !

    Hi ,
    I had an ALV Report. I want to send this report output to patricular email id every day ! Presenty i do this manually. I run the report and send the output to the particular email address. Now i want to schecule the report daily in background and the out put of the report should be mailed to particular email ids in background itself. How can i do this ?
    Is there and method or setting through which we can do this ?
    Regards

    Hi Nau,
    For this requirement you will have to write another program.
    This program will convert the spool requests into PDF document and sends an email  to the recipients that you specify.
    These are the threads which are already posted in The SDN.
    *http://wiki.sdn.sap.com/wiki/display/Snippets/Converts+spool+request+into+PDF+document+and+emails*
    *<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="353650"></a>*
    *<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="902985"></a>*
    You need to use the Function module :
    -- Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    I will provide you with the code to get this functionality.
    *&      Form  SEND_EMAIL
    form SEND_EMAIL .
    DATA:   t_mailpack   TYPE sopcklsti1 OCCURS 0 WITH HEADER LINE,
              t_mailhead   TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailbin    TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailtxt    TYPE solisti1   OCCURS 0 WITH HEADER LINE,
              t_mailrec    TYPE somlreci1  OCCURS 0 WITH HEADER LINE.
      DATA: wa_maildata    TYPE sodocchgi1,
            l_filename(50) TYPE c,
            l_fldname(30)  TYPE c,
            l_fldval(100)  TYPE c,
            l_lines        TYPE i,
            l_text         TYPE text128 .
      DATA: w_email_subrc  TYPE i.
      DATA: w_ship like vbfa-vbeln.
      CLEAR: wa_maildata,
             t_mailtxt,
             t_mailbin,
             t_mailpack,
             t_mailhead,
             t_mailrec.
      REFRESH: t_mailtxt,
               t_mailbin,
               t_mailpack,
               t_mailhead,
               t_mailrec.
    *-- Fill output file
    *- Fill header
      CLEAR: t_mailbin.
    *  t_mailbin[] = pdf_tab[].
      t_mailbin[] = it_att[].     "Uthaman
    *This line is added to get the shipment no in Subject Line
    SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
                                AND vbtyp_v EQ c_vbtyp_v_j
                                AND vbtyp_n EQ c_vbtyp_n_8.
    w_ship = vbfa-vbeln.
    shift w_ship left deleting leading '0'.
    *-- File name
    if nast-kschl EQ 'ZFPL'.
      CLEAR l_filename.
      CONCATENATE 'Packing List -'
                  sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF' INTO l_filename.
    *-- Creation of the document to be sent File Name
      wa_maildata-obj_name = 'Packing List'.
    *-- Mail Subject
      CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
    *-- Mail Contents
      t_mailtxt-line = 'Packing List'.
      APPEND t_mailtxt.
    ENDIF.
    if nast-kschl EQ 'ZFBA'.
      CLEAR l_filename.
      CONCATENATE 'Booking Advice -'
                  sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF'
                  INTO l_filename.
    *-- Creation of the document to be sent File Name
      wa_maildata-obj_name = 'Booking Advice'.
    *-- Mail Subject
      CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
    *-- Mail Contents
      t_mailtxt-line = 'Packing List'.
      APPEND t_mailtxt.
    ENDIF.
    *-- Prepare Packing List
    *-- Write Packing List (Main Subject)
      CLEAR: l_lines, t_mailpack.
      DESCRIBE TABLE t_mailtxt LINES l_lines.
    *  READ TABLE t_mailtxt INDEX l_lines.
      t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailtxt ).
    *  CLEAR t_mailpack-transf_bin.
      t_mailpack-transf_bin = ' '.
      t_mailpack-head_start = 1.
      t_mailpack-head_num = 0.
      t_mailpack-body_start = 1.
      t_mailpack-body_num = l_lines.
      t_mailpack-doc_type = 'RAW'.
      APPEND t_mailpack.
      t_mailhead = l_filename.
      APPEND t_mailhead.
    *-- Write Packing List (Attachment)
      CLEAR: l_lines, t_mailpack.
      DESCRIBE TABLE pdf_tab[] LINES l_lines.
    *  READ TABLE pdf_tab INDEX l_lines.
      t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailbin ).
      t_mailpack-transf_bin = 'X'.
      t_mailpack-head_start = 1.
      t_mailpack-head_num = 1.
      t_mailpack-body_start = 1.
      t_mailpack-body_num = l_lines.
      t_mailpack-doc_type = 'PDF'.
      t_mailpack-obj_name = l_filename.
      t_mailpack-obj_descr = l_filename.
      t_mailpack-obj_langu = 'E'.
      APPEND t_mailpack.
    *-- Set recipients
    tables :  ztotcemail.
    SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
                                AND vbtyp_v EQ c_vbtyp_v_j
                                AND vbtyp_n EQ c_vbtyp_n_8.
    CLEAR vttk.
    SELECT SINGLE * FROM vttk WHERE tknum EQ vbfa-vbeln.
    SELECT SINGLE * FROM ztotcemail WHERE tplst = vttk-tplst
                                      AND lifnr = vttk-tdlnr.
    IF SY-SUBRC EQ 0.
      t_mailrec-receiver = ztotcemail-smtp_addr. "'Here you will give the email address'.
      t_mailrec-rec_type  = 'U'.
      APPEND t_mailrec.
    ENDIF.
    **-- Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_maildata
          put_in_outbox              = 'X'
    *      commit_work                = 'X'  " N-16
        TABLES
          packing_list               = t_mailpack
          object_header              = t_mailhead
          contents_bin               = t_mailbin[]
          contents_txt               = t_mailtxt[]
          receivers                  = t_mailrec
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      w_email_subrc = sy-subrc.
      IF sy-subrc EQ 0.
        MESSAGE s000(zotc) WITH 'Email output sent successfully'.
      ELSE.
        MESSAGE s000(zotc) WITH 'Can not send email output'.
      ENDIF.
    endform.                    " SEND_EMAIL
    Hope the above information will be helpful.
    Regards,
    Kittu

  • List output in Module pool programming

    Hi Gurus.,
            I need to use write statement to display output using Call Screen xxx starting at xx ending at xx as dialog box .. How can i achieve this ...I tried the following in PBO of the screen but only a blank screen comes as output ...
    *&      Module  STATUS_0102  OUTPUT
          text
    MODULE STATUS_0102 OUTPUT.
      SET PF-STATUS 'MENU1' OF PROGRAM 'ZHM053C_MB01_J1IFQ_J1IF13'.
    SET TITLEBAR 'xxx'.
      ULINE.
      WRITE: / '                                                *************EXECUTION SUMMARY*************                                               ' COLOR 4.  ULINE.
      WRITE / ''.
      SKIP 1.
      LOOP AT IT_MESS.
        IF IT_MESS-MSGTYP EQ 'E'.
          FORMAT COLOR 7 .
          WRITE :  IT_MESS-MESSAGE.
        ELSE.
          FORMAT COLOR 2 .
          WRITE :  IT_MESS-MESSAGE.
        ENDIF.
        AT END OF TCODE.
          WRITE / SY-ULINE.
        ENDAT.
      ENDLOOP.
    ENDMODULE.                 " STATUS_0102  OUTPUT
    please help me its very urgent
    Regards.,
    S.Sivakumar

    Hi,
    REPORT demo_leave_to_list_processing .
    TABLES sdyn_conn.
    DATA: wa_spfli TYPE spfli,
          flightdate TYPE sflight-fldate.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE user_command_0100.
      CALL SCREEN 500.
      SET SCREEN 100.
    ENDMODULE.
    MODULE call_list_500 OUTPUT.
      LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
      SET PF-STATUS space.
      SUPPRESS DIALOG.
      SELECT  carrid connid cityfrom cityto
        FROM  spfli
        INTO  CORRESPONDING FIELDS OF wa_spfli
        WHERE carrid = sdyn_conn-carrid.
        WRITE: / wa_spfli-carrid, wa_spfli-connid,
                 wa_spfli-cityfrom, wa_spfli-cityto.
        HIDE: wa_spfli-carrid, wa_spfli-connid.
      ENDSELECT.
      CLEAR: wa_spfli-carrid.
    ENDMODULE.
    TOP-OF-PAGE.
      WRITE text-001 COLOR COL_HEADING.
      ULINE.
    TOP-OF-PAGE DURING LINE-SELECTION.
      WRITE sy-lisel COLOR COL_HEADING.
      ULINE.
    AT LINE-SELECTION.
      CHECK not wa_spfli-carrid is initial.
      SELECT  fldate
        FROM  sflight
        INTO  flightdate
        WHERE carrid = wa_spfli-carrid AND
              connid = wa_spfli-connid.
         WRITE / flightdate.
      ENDSELECT.
      CLEAR: wa_spfli-carrid.
    This example switches to list processing during the screen processing for screen 100. Screen 100 has a single input field - the component CARRID from the ABAP Dictionary structure SDYN_CONN.
    The flow logic of screen 100 is:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
    PROCESS AFTER INPUT.
      MODULE cancel AT EXIT-COMMAND.
      MODULE user_command_0100.
    The PAI module user_command_0100 calls screen 500 using the CALL SCREEN statement. This screen encapsulates a basic list. It has the following flow logic:
    PROCESS BEFORE OUTPUT.
      MODULE call_list_500.
    PROCESS AFTER INPUT.
    The module call_list_500 defines the basic list and switches to list processing. Since the next screen after list processing is screen 0, screen 500 is a one-screen screen chain. After list processing, control returns to the position in user_command_0100 from which screen 500 was called.
    If the user selects a line on the basic list, a detail list appears. This is achieved through the event block AT LINE-SELECTION. The program also contains event blocks for TOP-OF-PAGE and TOP-OF-PAGE DURING LINE-SELECTION, which define page headers for both the basic list and detail list.
    Since there is only one list system in this program, there is no need for case distinctions within the list events.
    With thanks & regards,
    Sravani yendru.

  • How to insert field to database through module pool.

    Hi All,
    I am working on module pool,i have taken the itab with header line and structures also.
    inorder to update  fields to different tbales what is the logic i need to right.
    i have taken move command i have written move scree-fields to structure
    then  have modify dbtable from structure.but no result only current record is updating
    please help me.

    Hi Saroja,
    INSERT INTO scarr values scarr_wa
    If you use above statement, it updates only one record.
    INSERT INTO scarr FROM TABLE itab.
    If you use above statement, it updates all records available in itab.
    Choose which one u want to use and update the table.
    Thanks
    Venkat.O

  • Select-option length specification (in report program, not module pool)

    Dear forumers,
    Is there a way to properly customize the length of a select-option in a report program?
    Currently, the select-option S_ADMAIL is shown in the selection screen at a length of 18 characters. No matter what I've coded, this length does not change. The requirement states for the length to be shown at 40 characters long:-
    Admin Email (type STRING showing up to 40 char on screen)
    How may I fix the select-option's visible length to 40 characters?
    DATA: v_admail TYPE string.   " Tried with TYPE CHAR40 too
    SELECT-OPTIONS: s_admail FOR (v_admail) NO INTERVALS VISIBLE LENGTH 40.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name CS 'S_ADMAIL'.
          screen-length = 40.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    Perhaps there is an FM that can accomplish this (but I'm not sure what it is)? Please do help. Thanks a lot.

    Dear Tan,
    Tables : makt.
    select-options maknr for makt-maktx.
    now go to the screen painter of your program in change mode and move the Help buttons first to the Right each. now *increasethe length of the Matnr Field length so that they are equal to 40 Char. in your program you have handle the length now if you want to restrict to 18 otherwise it will be ok*
    if they don't fit you need incease the Size of the Screen Visible area both in the Screen Painter as well as in the
    Screen Attributes
    You also get an Information Message just ignore that.
    Just open your program in SE80 if you can't go to the screen painter in SE38. the other way just keep this program in Display mode and execute then take F1 help , take Technical Information and double click on the Screen number now go to the Screen Layout and go to Change mode here.
    Hope this is Very Clear to you.
    I just did it
    Cheers
    Ram
    Edited by: Ramchander Krishnamraju on Oct 27, 2009 10:39 AM
    Edited by: Ramchander Krishnamraju on Oct 27, 2009 10:46 AM

  • Title of the browser displaying a report output through web.show_document

    Hiya
    We are using Oracle Forms 10g 10.1.2.0.2
    All our Forms and Reports are working well.
    We are using Java Script in Web.Show_Document so that when the report is displayed on the screen in the browser, the browser's toolbar and menubar should not be visible.
    The code looks like this:
    v_url_in := 'reports/rwservlet' || '/getjobid' || v_job_id || '?server='|| 'my_rep_server';
    v_url_out := 'javascript:window.open("'||v_url_in||'", " ", "toolbar=no,menubar=no");self.close();';
    Web.Show_Document (v_url_out, '_blank');
    The above code is working absolutely fine. No issues about this.
    Now when the report opens in a new browser window,the title of the browser window reads as follows:
    http://<hostname>:8889/reports/rwservlet/getjobid1234?server=my_rep_server - Microsoft Internet Explorer
    So rather than displaying the title of the browser window as the URL of our Application Server, we want to show the title to Reports name so that it
    reads as
    'Customer Sales Summary Report - Microsoft Internet Explorer'.
    Does anyone has any idea if it is possible to change the title of the browser window, if so, how ?
    Cheers
    Mayur

    Mayur,
    I'm not a web developer either, however, I've done this kind of thing using the HTP database package - as I mentioned. What you could do is write a database procedure that accepts the URL and the Title as parameters and let the procedure open the URL for you. For example:
    CREATE OR REPLACE PROCEDURE show_url(p_url VARCHAR2, p_title varchar2) AS
    BEGIN
       htp.htmlOpen;
       htp.headOpen;
       htp.htitle(p_title);
       htp.headClose;
       htp.bodyOpen( cattributes => 'onLoad="WinOpen()"');
       htp.bodyOpen;
       htp.script(clanguage => 'javascript',
                    cscript => '<!--
                                function WinOpen() { open("'||p_url||'","_self");
                                //-->'
       htp.bodyClose;
       htp.htmlClose;
    END;I was unable to test this procedure on my Oracle XE install, but it should work on a non-XE database.
    Hope this helps.
    Craig...
    -- If my response or the response of another is helpful or answers your question, please mark the response accordingly. Thanks!

  • Calling a report from module pool program

    Hi all,
            I had a requirement where I need to call a report from the module pool program where in when we click REPORT button, it should display the report output in the another screen.
    Can we do by calling screen after pushing REPORT button. If so, where we should write that code ( In pbo or pai). Please give me an idea.
    Thanking you,
    Regards,
    Murali Krishna T

    Use submit syntax.
    Press F1 on submit, Donot use return statement with it.
    If so, where we should write that code ( In pbo or pai).
    Please understand about these two events before doing the requirement.

  • Calling a report from Module Pool

    While calling a report from the module pool I'm not able to display th alv. The skeleton of the ALV is coming. But the data and headings are also not displayed.
    But where as calling the same program from a report it is coming properly. can somebody please guide me where did I go wrong?

    MODULE user_command_1001 INPUT.
      w_ok_code = ok_code.
      CLEAR ok_code.
      CASE w_ok_code.
        WHEN 'BACK'.
          LEAVE PROGRAM .
        WHEN 'CREATE'.
          CALL TRANSACTION 'Z_FIRST_TIME'.
        WHEN 'SYNC'.
          CALL TRANSACTION 'Z_SYNC'.
        WHEN 'APPROVE'.
         SUBMIT zds_xx_approval_status WITH po_aname EQ sy-uname AND RETURN.
        WHEN 'OVERVIEW'.
          PERFORM show_all_reqids.
      ENDCASE.
    ENDMODULE.

  • Module Pool+TOP+report prog,, Shuld I move to TEST individually?

    Hi Experts,
    I enhanced one Module Pool Prog., which contains 3 parts i.e.
    1 - Main Module Prog.
    2- Top include
    3- One error report prog. i.e. executable prog.
    So,
    Now, I need to move this main Module prog. to TEST box,
    So,
    1) I guess I need to move to TEST box, all 3 individually, in the order of TOP , ERROR report prog., Main Module pool prog.
    2) Or if I move the Main Module pool to TEST, automatically, SAP picks the rest 2 items, even though I did not moved manually?
    thanq.

    This is depends on ur transport request ,did you save all programs in one request,if so it will go automatically.
    if you create transport request indiviudlly ,then need to transport one by one.
    anyhow check in se10 ->main request - sub request -> check ur objects.

Maybe you are looking for

  • Saving Mail (Add a Folder?)

    I would like to be able to save important emails on my iPhone without having to worry about accidentally deleting them when cleaning out my InBox. Am using POP mail. Posted this earlier and received response the option did not exist. Was wondering if

  • Error While Configuring the Shared Service with Active Directory

    Hi All, I am getting a error while configuring MSAD with Shared Service, when entering the User Id and password and clicking next, the following error is displayed: "EPMCSS-05180:Failed to validate Security configuration. Failed to connect. Invalid v

  • ABAP program to load an infocube

    Hello All, I am new to BW and have learnt the basic concepts only. I now have to write an ABAP program to load one of the infocube after receiving the data in the form of a flat file from an external system. Any ideas on how I can go about this will

  • JSP and Netscape frame target bug. HELP!!!!!!!!

    Hello All, I have a frameset that has 4 frames. In one of the frames I submit a form which processes some jsp code. The jsp code then is suppossed to load a new page in another frame (I have the target="MyFrame" in the form). In IE it works fine and

  • The logo for the application has been changed in Azure portal, but it's not reflected during the login

    Hi Azure support, my name is Linda, Office365 technical support. I want to ask one Azure question on behalf on my customer. she has AAD_basic subscription. she tried to change logo of one application, but failed. she followed the steps as below: 1. a