Internal table to AVL report

Hi all,
I have one final internal table created which does not have a fixed structure in a normal ABAP classical report in se38.
It has fields from VBRK , VBRP, t001, etc...I have got all the data appended to final table it_final.
Now I want to create ALV report wthout creating fieldcatalogue for individual fields.
Also used ALVMERGE* function module but it requires a fixed structure that is present in se11 so it cant be used.
So i want to create a ALV Grid report. Kindly revert with proper code.

Hi,
   Take the fields from various fields into the final table and append the final table.
Once you append the final Table
For eg:
          Take a final table i.e it_final.
go with the grid function i.e
        REUSE_ALV_GRID_DISPLAY.
in this give data in I_CALLBACK_PROGRAM
and in tables t_outtab = it_final.
eg Programme:
tables:sflight.
type-pools:slis.
data:itab type table of sflight with header line.
select * from sflight up to 10 rows
into table itab.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                = ' '
*   I_BUFFER_ACTIVE                   = ' '
   i_callback_program                = sy-repid
   i_callback_pf_status_set          = 'SET_PF'
   i_callback_user_command           = 'USER_COMMAND'
*   I_CALLBACK_TOP_OF_PAGE            = ' '
*   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*   I_CALLBACK_HTML_END_OF_LIST       = ' '
   i_structure_name                  = 'SFLIGHT'
*   I_BACKGROUND_ID                   = ' '
*   I_GRID_TITLE                      =
*   I_GRID_SETTINGS                   =
*   IS_LAYOUT                         =
*   IT_FIELDCAT                       =
*   IT_EXCLUDING                      =
*   IT_SPECIAL_GROUPS                 =
*   IT_SORT                           =
*   IT_FILTER                         =
*   IS_SEL_HIDE                       =
*   I_DEFAULT                         = 'X'
   i_save                            = 'X'
*   IS_VARIANT                        =
*   IT_EVENTS                         =
*   IT_EVENT_EXIT                     =
*   IS_PRINT                          =
*   IS_REPREP_ID                      =
*   I_SCREEN_START_COLUMN             = 0
*   I_SCREEN_START_LINE               = 0
*   I_SCREEN_END_COLUMN               = 0
*   I_SCREEN_END_LINE                 = 0
*   I_HTML_HEIGHT_TOP                 = 0
*   I_HTML_HEIGHT_END                 = 0
*   IT_ALV_GRAPHICS                   =
*   IT_HYPERLINK                      =
*   IT_ADD_FIELDCAT                   =
*   IT_EXCEPT_QINFO                   =
*   IR_SALV_FULLSCREEN_ADAPTER        =
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER           =
*   ES_EXIT_CAUSED_BY_USER            =
  tables
    t_outtab                          = itab
* EXCEPTIONS
*   PROGRAM_ERROR                     = 1
*   OTHERS                            = 2
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
*&      Form  set_pf_status
*       text
*      -->RT_EXTAB   text
form set_pf using rt_extab type slis_t_extab.
  set pf-status 'ZSTANDARD_FULLSCREEN'.
endform.                    "set_pf_status
*&      Form  user_command
*       text
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
form user_command  using r_ucomm like sy-ucomm
                                 rs_selfield type slis_selfield.
  message:'hello' type 'I'                                 .
  read table itab index 1.
  itab-carrid = 'RR'.
  modify itab index 1.
endform.                    "user_command

Similar Messages

  • How to create an internal table in a Report from File of FTP Server.

    Hi All,
    I want to create an internal table in a Report program. But the problem is I have to download two latest files from FTP server.
    Now, based in those file I have to design internal tables in current program. The problem is the program from which these files are being generated has options to display some fields in the output. Hence, the columns of these files becomes dynamic due to which I am not able to design the internal table in my current program...Please Help.
    Regards & Thanks.
    Prashant.

    Hi,
    Or you can use the RTTS classes...
    Plenty of examples over here.
    one external link: http://help-abap.zevolving.com/2008/09/dynamic-internal-table-creation/
    Kr,
    Manu.

  • How to Pass the Internal table of a report to Smart Form

    Hi Experts,
    I have one report in which from selection screen i am getting the values from the users, and upon that values i am filling data in to the internal table.
    Now i want to pass that internal table data to the smart form
    and print that data in the smart form.
    So could you pls give me some pseudo code or any steps to achieve it.
    Thanks & Regards,
    DS

    Hi DS,
    First of all you need to create a SF and then need to call the FM generated by the FM in your report.
    In the SF in the form interface>tables tab>mention the name of the table and its type structure.
    Pls note that a new structure has to be created as the same type of your internal table which holds the data.
    And the import and export parameters as just the same as in a FM.
    Now after you create and activate your SF a FM will be generated (wen u execute your SF you will be taken to this SE37 screen with the name of FM so no probs..)
    You can call this FM in your report. Hope this helps.
    Ex:
    say itab has your final data, and you also want to export a variable var1 to the SF.
    after your normal report operations end, call the FM and pass on these data.
    say your FM name is FM1.
    call function FM1
    exporting
    var1 = var1
    tables
    itab1 = itab1.
    pls note that in the SF also i gave the same names, it is not mandatory to give the same names.
    and as you want to print a table in the smartforms, you need to create a table in the smart forms and then display the data which is quite simple.
    Hope this helps...
    if you need any further explanations, pls revert...
    Regards,
    Narendra.
    Reward points if helpful!!!

  • How to use dynamic internal table in interactive report syntax

    pls let me know

    Hi Aarif,
    Go through the below code for better understanding:
    *& Report  ZDYN_INT_TABLE_02                                           *
    REPORT  ZDYN_INT_TABLE_02.
    TYPE-POOLS: slis.                      " ALV Global types
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    PARAMETERS : p_max(3) TYPE n OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    TYPES: BEGIN OF wa_gt_data,
              matnr TYPE mara-matnr,
           END OF wa_gt_data.
    DATA gt_data TYPE STANDARD TABLE OF wa_gt_data WITH HEADER LINE.
    *INITIALIZATION.
    v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data.
      PERFORM f_display_data.
         Form  f_read_data
    FORM f_read_data.
      SELECT matnr INTO TABLE gt_data
               FROM mara
                 UP TO p_max ROWS.
    ENDFORM.                               " F_READ_DATA
         Form  F_DISPLAY_DATA
    FORM f_display_data.
      DATA:
        l_column    TYPE sy-tabix,
        lp_struct   TYPE REF TO data,
        lp_table    TYPE REF TO data,      " Pointer to dynamic table
        ls_lvc_cat  TYPE lvc_s_fcat,
        lt_lvc_cat  TYPE lvc_t_fcat,       " Field catalog
        lt_fcat     TYPE slis_t_fieldcat_alv,  " Field catalog
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv,  " Field catalog
        ls_layout   TYPE slis_layout_alv.
      FIELD-SYMBOLS :
        <header>       TYPE ANY,
        <field_header> TYPE ANY,
        <field_mara>  TYPE ANY,
        <lt_data>      TYPE table.         " Data to display
      ls_lvc_cat-fieldname = 'COLUMNTEXT'.
      ls_lvc_cat-ref_table = 'LVC_S_DETA'.
      APPEND ls_lvc_cat TO lt_lvc_cat.
      ls_fieldcat-fieldname = 'COLUMNTEXT'.
      ls_fieldcat-ref_tabname = 'LVC_S_DETA'.
      ls_fieldcat-key  = 'X'.
      APPEND ls_fieldcat TO lt_fieldcat.
      DO p_max TIMES.
      For each line, a column 'VALUEx' is created in the fieldcatalog
      Build Fieldcatalog
       WRITE sy-index TO ls_lvc_cat-fieldname LEFT-JUSTIFIED.
        CONCATENATE 'VALUE' ls_lvc_cat-fieldname
               INTO ls_lvc_cat-fieldname.
        ls_lvc_cat-ref_field = 'VALUE'.
        ls_lvc_cat-ref_table = 'LVC_S_DETA'.
        APPEND ls_lvc_cat TO lt_lvc_cat.
      Build Fieldcatalog
        CLEAR ls_fieldcat.
        ls_fieldcat-fieldname = ls_lvc_cat-fieldname.
        ls_fieldcat-ref_fieldname = 'VALUE'.
        ls_fieldcat-ref_tabname = 'LVC_S_DETA'.
        APPEND ls_fieldcat TO lt_fieldcat.
      ENDDO.
    Create internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = lt_lvc_cat
        IMPORTING
          ep_table        = lp_table.
      ASSIGN lp_table->* TO <lt_data>.
    Create structure = structure of the internal table
      CREATE DATA lp_struct LIKE LINE OF <lt_data>.
      ASSIGN lp_struct->* TO <header>.
    Create field catalog from dictionary structure
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'MARA'
        CHANGING
          ct_fieldcat            = lt_fcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT lt_fcat INTO ls_fieldcat WHERE fieldname = 'MATNR'.
        ASSIGN COMPONENT 1 OF STRUCTURE <header> TO <field_header>.
        IF sy-subrc NE 0. EXIT .ENDIF.
        READ TABLE lt_fcat INTO ls_fieldcat INDEX sy-index.
        <field_header> = ls_fieldcat-seltext_m.
        IF <field_header> IS INITIAL.
          <field_header> = ls_fieldcat-fieldname.
        ENDIF.
        LOOP AT gt_data.
          l_column = sy-tabix + 1.
          ASSIGN COMPONENT 1 OF STRUCTURE gt_data TO <field_mara>.
          IF sy-subrc NE 0. EXIT .ENDIF.
          ASSIGN COMPONENT l_column OF STRUCTURE <header> TO <field_header>.
          IF sy-subrc NE 0. EXIT .ENDIF.
          WRITE <field_mara> TO <field_header> LEFT-JUSTIFIED.
        ENDLOOP.
        APPEND <header> TO <lt_data>.
      ENDLOOP.
      ls_layout-colwidth_optimize = 'X'.
      ls_layout-no_colhead = 'X'.
      ls_layout-zebra = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          is_layout   = ls_layout
          it_fieldcat = lt_fieldcat
        TABLES
          t_outtab    = <lt_data>.
    ENDFORM.                               " F_DISPLAY_DATA
    END OF PROGRAM Z_ALV_LIST_TRANSPOSED *********************
    *Always reward point for helpful answers
    Regards,
    Amit

  • Report output list to internal table using submit report

    Hello,
    I have a report that generates the output in the form of an abap list. I want this data in an internal table for further processing. the report internally does not do a export data to memory so i cannot use import later on to get the data.
    i did the following
    SUBMIT <report name> exportING LIST TO MEMORY and return.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = itab_list
      EXCEPTIONS
        not_found  = 4
        OTHERS     = 8.
    CALL FUNCTION 'LIST_TO_ASCI'
      EXPORTING
        list_index         = -1
      TABLES
        listasci           = ascitab
        listobject         = itab_list
      EXCEPTIONS
        empty_list         = 1
        list_index_invalid = 2
        OTHERS             = 3.
    This returns the data in the ascitab, but the data contains additional unwanted info like lines and hyphens etc. Also the data is in a table with a single column, so pulling out individuals fields is again an issue. Is there a way to get this data into an internal table directly?
    best regards,
    Suraj

    hi suraj
    export the internal table  of report
    DATA: BEGIN OF SR_VBAK ,
          VBELN LIKE VBAK-VBELN,
          END OF SR_VBAK.
    DATA: IR_VBAK LIKE STANDARD TABLE OF SR_VBAK WITH HEADER LINE.
    EXPORT IR_VBAK TO MEMORY ID 'SALES'.
           SUBMIT <program name in which u want internal table records > AND RETURN.
    now import that data in submit program  .
    here u have to creat a internal table with same structure as the internal table from which u r trying to export the data
    DATA: BEGIN OF SR_VBAK,
          VBELN LIKE VBAK-VBELN,
          END OF SR_VBAK.
    DATA : IR_VBAK LIKE STANDARD TABLE OF SR_VBAK WITH HEADER LINE.
    IMPORT IR_VBAK FROM MEMORY ID 'SALES'.
    regards
    ANIL CHAUDHaRY

  • How to export an internal table to another report while submitting ..

    Hi ,
    I have 2 reports ZR1 and ZR2 . Both contains an Internal table with same structure IT_DATA. After the output of ZR1 comes,I am submitting ZR2 at a click event. The requirement is to pass the data from IT_DATA from ZR1 to IT_DATA of ZR2 while submitting ZR2.
    Hope that the requirement is clear.
    Thanks & regards,
    Shankar

    Hi
    You have to use IMPORT/EXPORT statament
    REPORT ZREPORT1.
    DATA: ITAB LIKE .....
    EXPORT ITAB TO MEMORY ID 'ZZZ'.
    SUBMIT ZREPORT2.
    REPORT ZREPORT2.
    DATA ITAB LIKE
    INITIALIZATION.
    IMPORT ITAB FROM MEMORY ID 'ZZZ'.
    Max
    Message was edited by: max bianchi

  • How to display 2 internal tablea in one report

    hi
    experts can u help me for this

    suppose you are using 2 tables mara and marc
    move the data into 2 internal tables i_mara and i_marc.
    then move the data into i_out.
    write the data of i_out.
    see this code for data from 4 tables
    REPORT  YSG_MATSTKREPT LINE-SIZE 125.
                             LINE-COUNT 50(5).
    *&                       DATA DECLARATION                              *
    TABLES: MARA,              "GENERAL MASTER DATA
            MARC,              "PLANT DATA FOR MATERIAL
            MARD,              "STORAGE LOCATION DATA FOR MATERIAL
            MAKT.              "MATERIAL DESCRIPTION
    DATA: BEGIN OF I_MARA OCCURS 0,
               MATNR LIKE MARA-MATNR,"MATERIAL NUMBER
          END OF I_MARA.
    DATA: BEGIN OF I_MARC OCCURS 0,
              MATNR LIKE MARC-MATNR,"MATERIAL NUMBER
              WERKS LIKE MARC-WERKS,"PLANT
          END OF I_MARC.
    DATA: BEGIN OF I_MAKT OCCURS 0,
               MATNR LIKE MAKT-MATNR,"MATERIAL NUMBER
               MAKTX LIKE MAKT-MAKTX,"MATERIAL DESCRIPTION
          END OF I_MAKT.
    DATA: BEGIN OF I_MARD OCCURS 0,
               MATNR LIKE MARD-MATNR,"MATERIAL NUMBER
               WERKS LIKE MARD-WERKS,"PLANT
               LGORT LIKE MARD-LGORT,"STORAGE LOCATION
               LABST LIKE MARD-LABST,"VALUATED STOCK WITH UNRESTRICTED USE
          END OF I_MARD.
    DATA: BEGIN OF I_OUT OCCURS 0,
            MATNR LIKE MARC-MATNR,
            WERKS LIKE MARC-WERKS,
            MAKTX LIKE MAKT-MAKTX,
            LGORT LIKE MARD-LGORT,
            LABST LIKE MARD-LABST,
          END OF I_OUT.
    DATA : TOT TYPE I, " TOT - TOTAL STOCK
           PLSTK TYPE I, " PLSTK - PLZNT WISE STOCK
           X TYPE C. "FLAG
    *&                   S E L E C T I O N - S C R E E N                   *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR .
    SELECTION-SCREEN END OF BLOCK B1.
    **&                  I N I T I A L I Z A T I O N                      *
    *INITIALIZATION.
    S_MATNR-SIGN = 'I'.
    S_MATNR-OPTION = 'EQ'.
    S_MATNR-LOW = 'M-12'.
    S_MATNR-HIGH = 'M-18'.
    *&             S T A R T - O F - S E L E C T I O N                     *
    START-OF-SELECTION.
    SELECT MATNR WERKS FROM MARC
                          INTO TABLE I_MARC
                          WHERE MATNR IN S_MATNR .
    SELECT MATNR WERKS LGORT LABST FROM MARD
                          INTO TABLE  I_MARD
                          FOR ALL ENTRIES IN I_MARC
                          WHERE MATNR = I_MARC-MATNR
                          AND WERKS = I_MARC-WERKS.
    SELECT MATNR MAKTX FROM MAKT INTO TABLE I_MAKT
                          FOR ALL ENTRIES IN I_MARC
                          WHERE MATNR = I_MARC-MATNR.
      LOOP AT I_MARC.
        MOVE I_MARC-MATNR TO I_OUT-MATNR.
        MOVE I_MARC-WERKS TO I_OUT-WERKS.
        READ TABLE I_MAKT WITH KEY MATNR = I_MARD-MATNR.
        MOVE I_MAKT-MAKTX TO I_OUT-MAKTX.
      LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR
                         AND WERKS = I_MARC-WERKS.
          MOVE I_MARD-LGORT TO I_OUT-LGORT.
          MOVE I_MARD-LABST TO I_OUT-LABST.
          APPEND I_OUT.
        ENDLOOP.
        CLEAR I_OUT.
      ENDLOOP.
    *&                  T O P - O F - P A G E                              *
    TOP-OF-PAGE.
      WRITE:/ 'DATE:' ,SY-DATUM.
      FORMAT COLOR 4 INTENSIFIED OFF.
      WRITE:/2 'PLANT',
             9 'STG.LOC',
            20 'MATERIAL.NO.',
            55 'DESCRIPTION',
            88 'STOCK'.
    *&                  E N D - O F - P A G E                              *
    END-OF-PAGE.
      WRITE: / SY-ULINE,
             /100 'PAGNO: ',SY-PAGNO,
             SY-ULINE.
    *&        E N D -- O F --  S E L E C T I O N                           *
    END-OF-SELECTION.
    SORT I_OUT ASCENDING BY WERKS LGORT.
      LOOP AT I_OUT.
        WRITE:/    SY-ULINE,SY-VLINE,
                   I_OUT-WERKS,SY-VLINE,
                   I_OUT-LGORT,SY-VLINE,
                   I_OUT-MATNR,SY-VLINE,
                   I_OUT-MAKTX,SY-VLINE.
                   AT END OF LABST.
                   WRITE: I_OUT-LABST,SY-VLINE.
                   ENDAT.
        TOT = TOT + I_OUT-LABST.
        AT END OF LABST.
        WRITE : TOT, SY-VLINE.
        ENDAT.
    *AT END OF WERKS.
    *NEW-PAGE.
    *ENDAT.
        AT LAST.
        FORMAT COLOR 7 INTENSIFIED OFF.
        WRITE : /87 'TOTAL STOCK = ',TOT.
        ENDAT.
      ENDLOOP.
    regards,
    srinivas

  • How to submit a report ,Passing the internal tables from parent report

    How to submit a report ,Passing the internal tables from the parent report ?

    The SUBMIT statement executes a report from within a report. i.e. you could have a drill-down which
    calls another report. Can only execute reports of type '1'.
    *Code used to execute a report
    SUBMIT Zreport.
    *Code used to populate 'select-options' & execute report
    DATA: seltab type table of rsparams,
          seltab_wa like line of seltab.
      seltab_wa-selname = 'PNPPERNR'.
      seltab_wa-sign    = 'I'.
      seltab_wa-option  = 'EQ'.
    load each personnel number accessed from the structure into
    parameters to be used in the report
      loop at pnppernr.
        seltab_wa-low = pnppernr-low.
        append seltab_wa to seltab.
      endloop.
      SUBMIT zreport with selection-table seltab
                                    via selection-screen.
    *Code used to populate 'parameters' & execute report
    SUBMIT zreport with p_param1 = 'value'
                    with p_param2 = 'value'.
    Other additions for SUBMIT
    *Submit report and return to current program afterwards
    SUBMIT zreport AND RETURN.
    *Submit report via its own selection screen
    SUBMIT zreport VIA SELECTION-SCREEN.
    *Submit report using selection screen variant
    SUBMIT zreport USING SELECTION-SET 'VARIANT1'.
    *Submit report but export resultant list to memory, rather than
    *it being displayed on screen
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    Once report has finished and control has returned to calling
    program, use function modules LIST_FROM_MEMORY, WRITE_LIST and
    DISPLAY_LIST to retrieve and display report.
    *Example Code (Retrieving list from memory)
    DATA  BEGIN OF itab_list OCCURS 0.
            INCLUDE STRUCTURE abaplist.
    DATA  END OF itab_list.
    DATA: BEGIN OF vlist OCCURS 0,
            filler1(01)   TYPE c,
            field1(06)    TYPE c,
            filler(08)    TYPE c,
            field2(10)    TYPE c,
            filler3(01)   TYPE c,
            field3(10)    TYPE c,
            filler4(01)   TYPE c,
            field4(3)     TYPE c,
            filler5(02)   TYPE c,
            field5(15)    TYPE c,
            filler6(02)   TYPE c,
            field6(30)    TYPE c,
            filler7(43)   TYPE c,
            field7(10)    TYPE c,
          END OF vlist.
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = itab_list
      EXCEPTIONS
        not_found  = 4
        OTHERS     = 8.
    CALL FUNCTION 'LIST_TO_ASCI'
      EXPORTING
        list_index         = -1
      TABLES
        listasci           = vlist
        listobject         = itab_list
      EXCEPTIONS
        empty_list         = 1
        list_index_invalid = 2
        OTHERS             = 3.
    IF sy-subrc NE '0'.
      WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
    ENDIF.
    Submit report as job
    *Submit report as job(i.e. in background)
    data: jobname like tbtcjob-jobname value
                                 ' TRANSFER TRANSLATION'.
    data: jobcount like tbtcjob-jobcount,
          host like msxxlist-host.
    data: begin of starttime.
            include structure tbtcstrt.
    data: end of starttime.
    data: starttimeimmediate like btch0000-char1.
    Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = ' '
                jobgroup         = ' '
                jobname          = jobname
                sdlstrtdt        = sy-datum
                sdlstrttm        = sy-uzeit
           importing
                jobcount         = jobcount
           exceptions
                cant_create_job  = 01
                invalid_job_data = 02
                jobname_missing  = 03.
      if sy-subrc ne 0.
                                           "error processing
      endif.
    Insert process into job
    SUBMIT zreport and return
                    with p_param1 = 'value'
                    with p_param2 = 'value'
                    user sy-uname
                    via job jobname
                    number jobcount.
      if sy-subrc > 0.
                                           "error processing
      endif.
    Close job
      starttime-sdlstrtdt = sy-datum + 1.
      starttime-sdlstrttm = '220000'.
      call function 'JOB_CLOSE'
           exporting
                event_id             = starttime-eventid
                event_param          = starttime-eventparm
                event_periodic       = starttime-periodic
                jobcount             = jobcount
                jobname              = jobname
                laststrtdt           = starttime-laststrtdt
                laststrttm           = starttime-laststrttm
                prddays              = 1
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = starttime-sdlstrtdt
                sdlstrttm            = starttime-sdlstrttm
                strtimmed            = starttimeimmediate
                targetsystem         = host
           exceptions
                cant_start_immediate = 01
                invalid_startdate    = 02
                jobname_missing      = 03
                job_close_failed     = 04
                job_nosteps          = 05
                job_notex            = 06
                lock_failed          = 07
                others               = 99.
      if sy-subrc eq 0.
                                           "error processing
      endif.

  • Horizontal to Vertical Convert Internal table in Classical report

    Hi Experts,
         I have internal table as like below for six column.
         I want to convert as like below in classical report.
       Here H001, H002, H003, H004 are vendor code it is dynamic.
    Thanks,
    Himanshu Patel.

    Hi Himanshu,
    Create a hotspot in write statement by adding HOTSPOT ON with write statement , then in at line selection add this code.
    Modify the PO Value based on your need.
    DATA: REPID(18) VALUE '4500017274'.
    SET PARAMETER ID 'BES'  FIELD REPID .
    CALL TRANSACTION 'ME23N' AND SKIP FIRST   SCREEN.
    This will call the screen by opening the Particular document Specified.
    Regards,
    Sivaganesh

  • How to get total in ALV report in same Internal table?

    Data : Begin of it_data,
            kunnr type kunnr,
            name1 type name1,
            amt1  type btrt01, " CURR 15,2
           end of it_data.
    loop at it_data into wa_data
    endloop.      
    Hello friends,
    I am developing one ALV report with 20 rows.
    I have filled one internal table with some fileds like amount.
    I want to get total of all amount1 in AMT1 field.
    So, How to get total of amount in same internal table in ALV report ?
    It is ok if i get duplicate rows in internal table.
    Points 'll be awarded soon.
    Regards,
    NVM

    Hi Ronny,
    the alv output will display the sum at the last row.
    for this functionality u have do this logic.
    data: lw_fcat type slis_fieldcat_alv.
    data: lt_fcat type slis_t_fieldcat_alv/
    wa_fcat-fieldname = 'AMT1'.
    wa_fcat-tabname = 'ITAB'.
    wa_fcat-do_sum = 'X'.
    append wa_fcat to lt_fcat.
    and then pass it to reuse_alv_grid_display function,
    regards,
    Santosh Thorat

  • Standard Report RM07MLBB output  in internal Table

    Hi Experts  ,
    i want Standard Report output  which is in basic List    to internal table  .
    standard report  RM07MLBB . i don't want  to use enhancement   nor Export /import 
    is there any other way  .
    regards
    Deepak.

    hi JACk  ,
    It was a perfect solution of using Include   and  using internal table of that report
    i have done certain modification  in  calling Program such as
    include rm07mlbb.
    at selection-screen output.
      perform hide_fields.                         " in order to hide screen of  include rm07mlbb  .
    loop at screen.
        if screen-name = 'LIFNR-LOW'  or
           screen-name = 'LIFNR-HIGH' or
           screen-name = 'MATNR-LOW'  or
           screen-name = 'MATNR-HIGH' or
           screen-name = 'WERKS-LOW'  or
           screen-name = 'WERKS-HIGH'  or
           screen-name = 'BUKRS-LOW'  or
           screen-name = 'BUKRS-HIGH'  or
           screen-name = '%_LIFNR_%_APP_%-TEXT' or
           screen-name = '%_LIFNR_%_APP_%-OPTI_PUSH' or
           screen-name = '%_LIFNR_%_APP_%-TO_TEXT' or
           screen-name = '%_LIFNR_%_APP_%-VALU_PUSH' or
           screen-name = '%_MATNR_%_APP_%-TEXT' or
           screen-name = '%_MATNR_%_APP_%-OPTI_PUSH' or
           screen-name = '%_MATNR_%_APP_%-TO_TEXT' or
           screen-name = '%_MATNR_%_APP_%-VALU_PUSH' or
           screen-name = '%_WERKS_%_APP_%-TEXT' or
           screen-name = '%_WERKS_%_APP_%-OPTI_PUSH' or
           screen-name = '%_WERKS_%_APP_%-TO_TEXT' or
           screen-name = '%_WERKS_%_APP_%-VALU_PUSH' or
           screen-name = '%_BUKRS_%_APP_%-TEXT' or
           screen-name = '%_BUKRS_%_APP_%-OPTI_PUSH' or
           screen-name = '%_BUKRS_%_APP_%-TO_TEXT' or
           screen-name = '%_BUKRS_%_APP_%-VALU_PUSH'  or
           screen-name = '%B002006_BLOCK_1000' or
           screen-name = '%B001000_BLOCK_1000' or
           screen-name = '%_ALV_DEF_%_APP_%-TEXT' or
           screen-name = 'ALV_DEF' or
           screen-name = 'NULLS'   or
           screen-name = '%_NULLS_%_APP_%-TEXT' .
         screen-invisible = 1.
          screen-active = 0.
          modify screen.
        endif.
      endloop.
      if not p_werks is initial .
        werks-low = p_werks.
        append werks.
      endif.
      if not p_bukrs is initial .
        bukrs-low = p_bukrs.
        append bukrs.
      endif.
      delete adjacent duplicates from werks comparing low.
      delete adjacent duplicates from bukrs comparing low.
    endform  " hide_fields
    Regards
    Deepak.

  • Export internal table from report to web-dynpro

    Hi,
    I am trying to export an internal table from a report to my web dynpro pragram however its not working.
    Statement used in my report -
    EXPORT it_ordbk FROM it_ordbk TO MEMORY ID 'ZORDBK'.
    Statement used in my web dynpro program
    IMPORT it_ordbk to it_ordbk  FROM MEMORY ID 'ZORDBK'.
    This dynpro application is being called in HTML container on the screen.
    Kindly help.
    Cordially,
    Danish

    Hi Danish,
    do not use export or import in Webdynpro.
    try to create a class with global variables and in the report or at the place of Export fille the data .
    and next in the place of Import memory to to call the global variable in the webdynpro and fill the internal table
    go to se24> create a zclasss->  methods initialize>create a ztable same as export table and also declare in glaobal vairaible
    --> next in the webdynpro program -->call the method retrive and push the global data to internal table.
    Prabhudas

  • IMPORT Statement Issue (Internal Table)

    Hi All,
    I am using an IMPORT statement to get all the data from other report's internal table. Now whenever this (the other report's internal table) is changed (for field addition, etc), my report throws a dump. Hence, everytime I have to add these fields in my program as well.
    Is there any way by which I can include the whole internal table of that report in my program just like
    'INCLUDE STRUCTURE VBRK'.
    Thanks in advance

    Hi, CHeck this code related to your problem..This will helpful to you...
    I have done this program earlier..I hope it will helpful to u..
    This programa calling the other program to import the data..
    Check it out...
    *" Tables declarations.................................................
    TABLES:
      spfli.
    *" Type declarations...................................................
    Type declaration of the structure to hold data from table SPFLI     *
    TYPES:
      BEGIN OF type_s_spfli,
        carrid LIKE spfli-carrid,          " Carrier Id
        connid LIKE spfli-connid,          " Connection Number
        cityfrom LIKE spfli-cityfrom,      " City from
        cityto LIKE spfli-cityto,          " City to
        airpfrom LIKE spfli-airpfrom,      " Airport from
        airpto LIKE spfli-airpto,          " Airport to
        countryfr LIKE spfli-countryfr,    " Country from
        countryto LIKE spfli-countryto,    " Country to
      END OF type_s_spfli.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from SPFLI          *
    DATA
      fs_spfli TYPE type_s_spfli.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SPFLI       *
    DATA
      t_spfli LIKE STANDARD TABLE OF fs_spfli.
    TYPES:
      BEGIN OF types_s_itab,
        carrid LIKE sflight-carrid,        " Carrier id
        connid LIKE sflight-connid,        " Connection number
        fldate LIKE sflight-fldate,        " Flight date
      END OF types_s_itab.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from SFLIGHT        *
    DATA
      fs_itab TYPE types_s_itab.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SFLIGHT     *
    DATA
      t_itab LIKE STANDARD TABLE OF fs_itab.
    *" Type declarations...................................................
    Type declaration of the structure to hold data from table SBOOK     *
    TYPES:
    BEGIN OF type_s_sbook,
       carrid LIKE sbook-carrid,           " Carrier Id
       connid LIKE sbook-connid,           " Connection Number
       fldate LIKE sbook-fldate,           " Flight date
       bookid LIKE sbook-bookid,           " Booking number
       loccuram LIKE sbook-loccuram,       " Local currency
       loccurkey LIKE sbook-loccurkey,
       order_date LIKE sbook-order_date,   " Booking date
    END OF type_s_sbook.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from BOOK           *
    DATA
      fs_sbook TYPE type_s_sbook.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SBOOK       *
    DATA
      t_sbook LIKE STANDARD TABLE OF fs_sbook.
    DATA
      w_checkbox.                          " Checkbox
    SELECT-OPTIONS:
      s_carr FOR spfli-carrid.             " Carrier id range
                          START-OF-SELECTION EVENT                      *
    START-OF-SELECTION.
      PERFORM selectq.
                          END-OF-SELECTION EVENT                        *
    END-OF-SELECTION.
      SET PF-STATUS 'YH1314_030502'.
      PERFORM display_basic.
    AT USER-COMMAND.
      PERFORM ucomm.
    *&    Form  selectq
        This subroutine retreive data from SPFLI table
      There are no interface parameters to be passed to this subroutine.
    FORM selectq .
      SELECT carrid                        " Carrier id
             connid                        " Connection number
             cityfrom                      " City from
             cityto                        " City to
             airpfrom                      " Airport from
             airpto                        " Airport to
             countryfr                     " Country from
             countryto                     " Country to
             INTO CORRESPONDING FIELDS OF TABLE t_spfli
             FROM spfli
             WHERE carrid IN s_carr.
    ENDFORM.                               " Selectq
    *&      Form  display_basic
        This subroutine displays data from internal table
      There are no interface parameters to be passed to this subroutine.
    FORM display_basic .
      LOOP AT t_spfli INTO fs_spfli.
        WRITE:
          / w_checkbox AS CHECKBOX,
            fs_spfli-carrid,
            fs_spfli-connid,
            fs_spfli-cityfrom,
            fs_spfli-cityto,
            fs_spfli-airpfrom,
            fs_spfli-airpto,
            fs_spfli-countryfr,
            fs_spfli-countryto.
      ENDLOOP.                             " LOOP AT T-SPFLI INTO...
    ENDFORM.                               " Display_basic
    *&      Form  UCOMM
      This subroutine for at user-command event
      There are no interface parameters to be passed to this subroutine.
    FORM ucomm .
      RANGES :
        r_carr FOR spfli-carrid,
        r_conn FOR spfli-connid,
        r_carrid FOR sflight-carrid,
        r_connid FOR sflight-connid,
        r_fldate FOR sflight-fldate.
      CASE sy-ucomm.
        WHEN 'DISPLAY'.
          DATA:
            lw_lines TYPE i,
            lw_lineno TYPE i VALUE 3.
          DESCRIBE TABLE t_spfli LINES lw_lines.
          DO lw_lines TIMES.
            READ LINE lw_lineno FIELD
                 VALUE w_checkbox   INTO w_checkbox
                       fs_spfli-carrid INTO  fs_spfli-carrid
                       fs_spfli-connid INTO  fs_spfli-connid.
            IF sy-subrc = 0.
              IF w_checkbox = 'X'.
                r_carr-sign = 'I'.
                r_carr-option = 'EQ'.
                r_carr-low = fs_spfli-carrid.
                APPEND r_carr.
                r_conn-sign = 'I'.
                r_conn-option = 'EQ'.
                r_conn-low = fs_spfli-connid.
                APPEND r_conn.
              ENDIF.                       " IF W_CHECKBOX = 'X'
            ENDIF.                         " IF SY-SUBRC = 0
            ADD 1 TO lw_lineno.
          ENDDO.                           " DO LW_LINES TIMES
          SUBMIT yh1314_030502_call
            WITH s_carr IN r_carr
            WITH s_conn IN r_conn
             AND RETURN.
          IMPORT t_itab FROM MEMORY ID 'YH1314'.
          LOOP AT t_itab INTO fs_itab.
            r_carrid-sign = 'I'.
            r_carrid-option = 'EQ'.
            r_carrid-low = fs_itab-carrid.
            APPEND r_carrid.
            r_connid-sign = 'I'.
            r_connid-option = 'EQ'.
            r_connid-low = fs_itab-connid.
            APPEND r_connid.
            r_fldate-sign = 'I'.
            r_fldate-option = 'EQ'.
            r_fldate-low = fs_itab-fldate.
            APPEND r_fldate.
          ENDLOOP.                         " LOOP AT T_ITAB INTO.....
          SELECT carrid                    " Carriee Id
                 connid                    " Connection number
                 fldate                    " Flight date
                 bookid                    " Booking number
                 loccuram                  " Local Currency
                 order_date                " Booking date
             INTO CORRESPONDING FIELDS OF TABLE t_sbook
             FROM sbook
             WHERE carrid IN r_carrid AND
                   connid IN r_connid AND
                   fldate IN r_fldate.
          IF SY-SUBRC NE 0.
            MESSAGE 'NO RECORDS FOUND'(006) TYPE 'S'.
          ENDIF.                           " IF SY-SUBRC NE 0
          LOOP AT t_sbook INTO fs_sbook.
            AT FIRST.
              WRITE: /5 'Carrier Id'(001),
                     20 'Conn Id'(002),
                     35 'Flight date'(003),
                     50 'Book Id'(004),
                     65 'Local Currency'(005).
            ENDAT.                         " AT FIRST
            WRITE: /5 fs_sbook-carrid,
                   20 fs_sbook-connid,
                   35 fs_sbook-fldate,
                   50 fs_sbook-bookid,
                   65 fs_sbook-loccuram CURRENCY fs_sbook-loccurkey.
          ENDLOOP.                         " LOOP AT T_SBOOK INTO.....
      ENDCASE.                             " CASE SY-UCOMM
    ENDFORM.                               " UCOMM
    Regards
    Kiran

  • How to find internal table column names

    Hi Friends,
    I have declared one internal table with 45 fields.
    Here is my situation.
    I need to create dynamic table with all above 45 fields and some more fields (approx 10 fields).
    I got the solution for creating dynamic table. Only thing is
    I have to assign all the above 75 columns to  other internal table.
    is there any way we can read internal table field names in the program.
    we can acheive this by hard coding the all 75 field names.
    since it is 75 columns, i want to pass one by one field dynamically to the other table.
    Pls give me a solution.
    thanks in advance.

    HI,
    Find the code for dynamical internal table., which helps to increase the fields in the internal table dynamically.
    REPORT ZTEST_R3.
    FIELD-SYMBOLS: <L_TABLE> TYPE TABLE,
    <L_LINE> TYPE ANY,
    <L_FIELD> TYPE ANY.
    DATA: IS_LVC_CAT TYPE LVC_S_FCAT,
    IT_LVC_CAT TYPE LVC_T_FCAT.
    DATA: NEW_TABLE TYPE REF TO DATA,
    NEW_LINE TYPE REF TO DATA.
    START-OF-SELECTION.
    IS_LVC_CAT-FIELDNAME = 'KUNNR'.
    APPEND IS_LVC_CAT TO IT_LVC_CAT.
    IS_LVC_CAT-FIELDNAME = 'NAME1'.
    APPEND IS_LVC_CAT TO IT_LVC_CAT.
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
    EXPORTING
    IT_FIELDCATALOG = IT_LVC_CAT
    IMPORTING
    EP_TABLE = NEW_TABLE.
    *Create a new Line with the same structure of the table.
    ASSIGN NEW_TABLE->* TO <L_TABLE>.
    CREATE DATA NEW_LINE LIKE LINE OF <L_TABLE>.
    ASSIGN NEW_LINE->* TO <L_LINE>.
    DO 2 TIMES.
    ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <L_LINE> TO <L_FIELD>.
    <L_FIELD> = SY-INDEX.
    ASSIGN COMPONENT 'NAME1' OF STRUCTURE <L_LINE> TO <L_FIELD>.
    <L_FIELD> = 'A'.
    INSERT <L_LINE> INTO TABLE <L_TABLE>.
    ENDDO.
    LOOP AT <L_TABLE> INTO <L_LINE>.
    WRITE:/ <L_LINE>.
    ENDLOOP.
    READ TABLE <L_TABLE> INTO <L_LINE> INDEX 2.
    <L_LINE>+10(2) = 'B'.
    MODIFY <L_TABLE> FROM <L_LINE> INDEX 2.
    LOOP AT <L_TABLE> INTO <L_LINE>.
    WRITE:/ <L_LINE>.
    ENDLOOP.

  • Problem in Importing Internal Table

    Dear All,
    I am exporting Internal table from Program1 as follows:
    REPORT  ZEXPORT_TEST                            .
    TYPES: BEGIN OF ITAB,
          MATNR TYPE MARA-MATNR,
          MATKL TYPE MARA-MATKL,
          END OF ITAB.
    DATA:IT TYPE TABLE OF ITAB .
    SELECT MATNR MATKL FROM MARA INTO TABLE IT UP TO 10 ROWS.
    EXPORT IT TO MEMORY ID 'EAI1'.
    WRITE:/'Exported Successfully'.
    And I am Importing same internal table into  program2
    REPORT  ZIMPORT_TEST  .
    TYPES: BEGIN OF ITAB,
          MATNR TYPE MARA-MATNR,
          MATKL TYPE MARA-MATKL,
          END OF ITAB.
    DATA:IT  TYPE TABLE OF ITAB,
         IT1 TYPE TABLE OF ITAB,
         WA TYPE ITAB.
    IMPORT IT1 FROM MEMORY ID 'EAI1'.
    IT[] = IT1[].
    LOOP AT IT INTO WA.
      WRITE:/ wa-matnr,
            / WA-MATKL.
    ENDLOOP.
    WRITE:/'Imported Successfully'.
    But progam1 exporting correctly the return code is 0 but program2 is not importing sucessfully return code is 4.
    Kindly help me to import.
    Thanks in Advance.

    Hi friend,
    When u use 'Export' and 'Import' statements, it refers local sap memory.
    So u need to use SUBMIT ZIMPORT_TEST AND RETURN  statement immediately after 'Export'.
    i.e.
    Report ZEXPORT_TEST.
    EXPORT IT TO MEMORY ID 'EAI1'.   < -
    Exported to common local sap memory
    SUBMIT ZIMPORT_TEST AND RETURN . <---- Controls goes to next program, within same session.
    Report ZIMPORT_TEST.
    IMPORT IT from MEMORY ID 'EAI1'.  <----
    Imports data from common local sap memory.
    If u want to run two independent reports one exporting, another importing, then u have to use
    'SET' and 'GET' parameter concept which refers global sap memory.
    Thanks..
    Edited by: Sap Fan on Feb 27, 2009 4:56 AM
    Edited by: Sap Fan on Feb 27, 2009 4:56 AM

Maybe you are looking for