GET statement and internal table

Hi community,
I use the GET statement and I want to use some older code segments.
I read somewhere that I can use the result of GET like an internal table.
So I tried to get the content of bsid into my internal table it_bsid. But that doesn't seem to work.
Do you have any advice in this?
I wanted to do the following:
TABLES:
        KNA1,
        BSID,
        BKPF.
DATA:
      it_bsid TYPE TABLE OF bsid WITH HEADER LINE,
      is_bsid LIKE LINE OF it_bsid,
GET bsid.
LOOP AT bsid.
  APPEND it_bsid.
ENDLOOP.
-or-
GET bsid.
LOOP AT bsid INTO is_bsid.
  APPEND is_bsid TO it_bsid.
ENDLOOP.
But in both cases I get an error.
' "VERSION ... ." expected after "BSID" '
Do you know what is the reason for that?
Regards
Tobias
Edited by: Tobias Oelschlaeger on Feb 29, 2008 4:18 PM

Hi Tobias,
first you have to assign a logical database which has BSID to your program (in program attributes).
Then GET is the event triggered by the next BSID record according to your selection. You can not LOOP here but you may append to an internal table. This table may be processed using LOOP in the END-OF-SELECTION event.
Read some documentation about LDB [Logical Databases|http://help.sap.com/erp2005_ehp_01/helpdata/en/f0/ca4584260211d28a430000e829fbbd/content.htm] - it may help to understand the concept of this obsolete technique.
Regards,
Clemens

Similar Messages

  • Control statement in internal tables

    hi experts,
    can any body will provide me the control statement of internal table.
                                                               thank you

    Hi,
    check this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9f1f35c111d1829f0000e829fbfe/content.htm
    Control Break Statements
    Control break statements are used to create statement blocks which process only specific table lines the LOOP – ENDLOOP block.
    You open such a statement block with the control level statement AT and close it with the control level statement ENDAT. The syntax is as follows:
    Table should be sorted when you use control-break statements
    You can break the sequential access of internal tables by using these statements.
    Syntax:
    At first.
    <Statement block>
    Endat.
    This is the first statement to get executed inside the loop (remember control break statements are applicable only inside the loop)
    So in this block you can write or process those statements which you want to get executed when the loop starts.
    At New carrid.
    Write:/ carrid.
    Endat.
    In this case whenever the new carrid is reached, carrid will be written.
    At End of carrid.
    Uline.
    Endat.
    In this case whenever the end of carrid is reached, a line will be drawn.
    At Last.
    Write:/ ‘Last Record is reached’.
    Endat.
    Processing of statements within this block is done when entire processing of entire internal table is over. Usually used to display grand totals.
    You can use either all or one of the above control break statements with in the loop for processing internal table.
    At end of carrid.
    Sum.
    Endat.
    In above case the statement SUM (applicable only within AT-ENDAT) will sum up all the numeric fields in internal table and result is stored in same internal table variable.
    Regards,
    Sruthi

  • SAP QUERY LOOPS AND INTERNAL TABLE

    Hi All, I have a query which i have made. It runs from Table EKPO which has PO details and what I want to do is now via ABAP Code pull through the total of goods receipt for the PO and Line Item into a field. Sounds Easy enough..Problem now,
    The table which contains the GR data is EKBE which agains a PO and Line Item can have many 101 movements and 102 movements so what I want is an ABAP Statent to basically sum up the total of 101 for the PO & LINE ITEMS and then minus this from the total of 102 for the PO & LINE ITEMS and post the result in to this new field I have created.
    I am pretty decent with ABAP Code in Querys I.e Select statements etc but from what I can see i need to create an internal table and do a loop and collect statement but I keep on failing due to not enough knowledge. Please can some one help me with this and provide me with the code and explanation as i would like to understand,
    POINTS WILL BE REWARDED
    Thanks
    Kind Regards
    Adeel Sarwar

    Hi,
    This is the full code i have entered but its not working. Any help would be appreciated. If you could rectify the code and internal tables that would be great.
    Thanks
    TABLES: EKBE.
    DATA: PurO LIKE EKPO-EBELN,
          POLI LIKE EKPO-EBELP.
    *New Table and Vars defined
    DATA:   BEGIN OF IT_EKBE,
              IT_EKBE LIKE EKBE,
            END OF IT_EKBE.
    DATA:  BEGIN OF IT_SUM OCCURS 0,
              EBELN TYPE EBELN,
              EBELP TYPE EBELP,
              DMBTR TYPE DMBTR,
              MENGE TYPE MENGE,
          END OF IT_SUM.
    CLEAR: QTYD.
    MOVE: EKPO-EBELN TO PurO,
          EKPO-EBELP TO POLI.
    SELECT * FROM EKBE INTO IT_EKBE
        WHERE EBELN = PurO
        AND   EBELP = POLI
        AND   BEWTP = 'E'
    LOOP AT IT_EKBE.
      MOVE CORRESPOING IT_EKBE TO IT_SUM.
      IF IT_EKBE-BWART = '102'.
        IT_SUM-DMBTR = IT_SUM-DMBTR * -1.
        IT_SUM-MENGE = IT_SUM-MENGE * -1.
      ENIDF.
      COLLECT IT_SUM.
      CLEAR IT_SUM.
    ENDLOOP.
    ENDSELECT.
    If sy-subrc = 0.
      QTYD = IT_SUM.
    ELSE.
      QTYD = 0.
    ENDIF.

  • Update statement in Internal Table

    Plz tell me the syntax and e.g. of update statement in Internal Table program
    Moderator message: Welcome to SCN, please research yourself before asking basic questions.
    Edited by: Thomas Zloch on Feb 25, 2010 12:47 PM

    Hi,
    Use UPDATE statement , check below description from SAP help.
    UPDATE dbtab FROM TABLE itab. or UPDATE (dbtabname) FROM TABLE itab.
    Effect
    Mass update of several lines in a database table.Here, the primary key for identifying the lines tobe updated and the values to be changed are taken from the lines of theinternal table itab. 
    The system field SY-DBCNT contains the number of updated lines,i.e. the number of lines in the internal table itab which havekey values corresponding to lines in the database table.
    Regards
    L Appana

  • Getting data into internal table wa_final

    Hi Guys
    I have change the logic for this program , I have created 2 workareas and internal table now I need help to place the data into
         wa_final-max_date = wa_data-idate.
             wa_final-min_date  = wa_data-idate.
             wa_final-max_km  = wa_data-recdv.
             wa_final-min_km  = wa_data-recdv.
             wa_final-max_hR   = wa_data-recdv.
             wa_final-min_hR   = wa_data-recdv.
             wa_final-max_lit  = wa_data-recdv.
             wa_final-min_lit  = wa_data-recdv.
             wa_final-t_max_min_km   = wa_data-recdv.  " min_km - max_km
             wa_final-t_max_min_hr  = wa_data-recdv.   " min_hr - max_hr
             wa_final-t_max_min_lit  = wa_data-recdv.  " min_lit - max_lit.
    so how can I put the logic to the value please correct my program.seeing my program can anyone give some idea ?
    REPORT Z_FUEL_MONTHLY_QTY LINE-SIZE  260 LINE-COUNT 75
             NO STANDARD PAGE HEADING.
    TABLES : equi,
             equz,
             imptt,
             imrg,
             eqkt,
             iloa.
    Type Declaration
    *DATA: BEGIN OF ty_equi occurs 0,
         equnr type equi-equnr,
         END OF ty_equi.
    *DATA: BEGIN of ty_eqkt occurs 0,
         equnr type eqkt-equnr,
         eqktx type eqkt-eqktx,
         END OF ty_eqkt.
    *DATA: BEGIN of ty_iloa occurs 0,
         iloan type iloa-iloan,
         eqfnr type iloa-eqfnr,
         END OF ty_iloa.
    *DATA: BEGIN of ty_imptt occurs 0,
         mpobj type imptt-mpobj,
         END of ty_imptt.
    *DATA: BEGIN of ty_imrg occurs 0,
         idate type imrg-idate,
         recdv type imrg-recdv,
         recdu type imrg-recdu,
         END of ty_imrg.
    TYPES:  BEGIN OF ty_data  ,
             equnr      type equnr,         " Euipment no
             eqktx      type eqkt-eqktx,    " Equipment Text
             eqfnr       type iloa-eqfnr,     " Equipment Sort field
             idate      type imrg-idate,    " Measuring Date
             recdu      type imrg-recdu,    " Unit of measuring ='KM','L','H'
             recdv      type imrg-recdv,    " Counter reading data
           END OF ty_data.
    TYPES: BEGIN OF ty_final,
             equnr           type equnr,            "  Equipment no
             eqktx           type eqkt-eqktx,       "  Equipment Text
             eqfnr           type iloa-eqfnr,       "  Equipment Sort field
             min_date        type imrg-idate,       "  Min Date
             min_km          type p decimals 2,     "  Max Km
             max_km          type p decimals 2,     "  Min km
             t_max_min_km    type i,                "  Total min_km-max_km
             max_date        type imrg-idate,       "  Max Date
             min_hr          type imrg-recdv,       "  Max hr
             max_hr          type imrg-recdv,       "  Min hr
             t_max_min_hr    type i,                "  Total min_hr-max_hr
             min_lit         type imrg-recdv,       "  Max lit
             max_lit         type imrg-recdv,       "  Min lit
             t_max_min_lit   type i,                "  Total min_lit-max_lit
             fuel_con        type p decimals 2,     "  Total_hrs / t_max_min_hr
             km_l            type p decimals 2,     "  km / L
             lit_per_hr      type i           ,     "  fuel comsumed / t_max_min_hr
           END OF ty_final.
    DATA: i_data TYPE TABLE OF ty_data, " internal table
    wa_data TYPE ty_data, " work area
    i_final TYPE TABLE OF ty_final, " internal table
    wa_final TYPE ty_final. " work area
    DATA :  max_date type date ,
             min_date type date,
             max_km TYPE p DECIMALS 2,
             min_km TYPE p DECIMALS 2,
             max_hr TYPE p DECIMALS 2,
             min_hr TYPE p DECIMALS 2,
             max_lit TYPE p DECIMALS 2,
             min_lit TYPE p DECIMALS 2,
             t_max_min_km  TYPE p DECIMALS 2,
             t_max_min_hr TYPE p DECIMALS 2,
             t_max_min_lit TYPE p DECIMALS 2.
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: p_equnr FOR equi-equnr, "no-extension no intervals,
                    p_idate FOR imrg-idate.  "NO-EXTENSION NO INTERVALS OBLIGATORY,
                    "p_recdu FOR imrg-recdu NO-EXTENSION NO INTERVALS ."default 'M3'" OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECTION-SCREEN END OF BLOCK blk.
    TOP-OF-PAGE.
      FORMAT INTENSIFIED ON.
      WRITE:/1(40) ' INVESTMENT LIMITED  '.
      WRITE:/50(40) ' FUEL CONSUMPTION REPORT ' CENTERED   ,
              2 'Page', sy-pagno.
      FORMAT INTENSIFIED OFF.
      WRITE:/50(40) '----
    ' CENTERED .
      FORMAT INTENSIFIED ON.
      WRITE:/2 sy-datum COLOR 3, sy-uzeit .
      "WRITE:/1 S903-SPMON ."p_yearf.
      ULINE.
      "CENTERED.
      write: /2 'Date From     :'.
      write: /2 'Equipment No  :'.
      write: /2 'Unit          :'.
      SKIP.
      ULINE.
      WRITE:/1 sy-vline,
        2   'EQUIP NO',              10 sy-vline,
        11  'NAME',                  40 sy-vline,
        41  'SORT',                  60 sy-vline,
        61  'MIN DATE',              74 sy-vline,
        75  'MAX DATE',              87 sy-vline,
        88  'MIN KM',                100 sy-vline,
        101  'MAX KM' ,              113 sy-vline,
        114 'TOTALK',                126 sy-vline,
        127  'MIN HR',               139 sy-vline,
        140 'MAX HR',                152 sy-vline,
        153 'TOTALH' ,               167 sy-vline,
        168 'MIN LIT',               180 sy-vline,
        181 'MAX LIT',               193 sy-vline,
        194 'TOTALL',                206 sy-vline,
        207 'FUEL CON',              219 sy-vline,
        220 'KM L',                  232 sy-vline,
        233 'LIT PER KM',            246 sy-vline.
      FORMAT COLOR 3 ON.
      ULINE.
    END-OF-PAGE.
    START-OF-SELECTION.
    select a~equnr d~eqktx f~eqfnr e~idate e~recdu e~recdv
    into table i_data
    from equi AS a
    inner join equz as b
    on a~equnr = b~equnr
    inner join iloa as f
    on b~iloan = f~iloan
    inner join imptt as c
    on a~objnr = c~mpobj
    inner join eqkt as d
    on a~equnr = d~equnr
    inner join imrg as e
    on e~point = c~point
    where a~equnr in p_equnr
    and
    e~idate in p_idate.
    loop  at i_data into wa_data.
    CLEAR: wa_final.
      READ TABLE i_final into wa_final
               with key equnr = wa_data-equnr.
        if sy-subrc EQ 0.
          PERFORM prepare_final_rec USING'M'. " Modify Existing Record
         ElSE.
          PERFORM prepare_final_rec USING'A'. " Append New Record.
        ENDIF.
        ENDLOOP.
        LOOP AT i_final into wa_final.
        WRITE:/1 sy-vline,
    2  wa_final-equnr                                                 , 10 sy-vline,
    11 wa_final-eqktx                                                 , 40 sy-vline,
    41 wa_final-eqfnr                                                 , 60 sy-vline,
    61 wa_final-min_date                                              , 74 sy-vline,
    75 wa_final-max_date                                              , 87 sy-vline,
    88 wa_final-min_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED           , 100 sy-vline,
    101 wa_final-max_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 113 sy-vline,
    114 wa_final-t_max_min_km EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED    , 126 sy-vline,
    127 wa_final-min_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 139 sy-vline,
    140 wa_final-max_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED          , 152 sy-vline,
    153 wa_final-t_max_min_hr EXPONENT 0 DECIMALS 2  LEFT-JUSTIFIED   , 167 sy-vline,
    168 wa_final-min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED         , 180 sy-vline,
    181 wa_final-max_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED         , 193 sy-vline,
    194 wa_final-t_max_min_lit EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED   , 206 sy-vline,
    207 wa_final-fuel_con EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED        , 219 sy-vline,
    220 wa_final-km_l EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED            , 232 sy-vline,
    233 wa_final-lit_per_hr EXPONENT 0 DECIMALS 2 LEFT-JUSTIFIED      , 246 sy-vline.
    ULINE.
    endloop.
    FORM prepare_final_rec  USING    p_mode TYPE char1.
    SORT i_data BY equnr idate descending .
            if wa_data-recdu = 'KM'.
            max_km = wa_data-recdv.
            min_km = wa_data-recdv.
            endif.
            if wa_data-recdu ='H'.
            max_hr = wa_data-recdv.
            min_hr = wa_data-recdv.
            endif.
            if wa_data-recdu ='L'.
            max_lit = wa_data-recdv.
            min_lit = wa_data-recdv.
           endif.
       at new equnr.
           read table i_final into wa_final index sy-tabix.
           write:/ wa_final-equnr, wa_final-eqktx ,wa_final-eqfnr ,wa_final-idate ,
           'Min KM',min_km EXPONENT 0 DECIMALS 2 color 7 ,
            'Min H',min_hr EXPONENT 0 DECIMALS 2 color 7 ,
             'Min L',min_lit EXPONENT 0 DECIMALS 2 color 7.
       endat.
    *at end of equnr.
           read table i_data into wa_data index sy-tabix.
           write:/ wa_final-equnr, wa_final-eqktx ,wa_final-eqfnr ,wa_final-idate ,
           'Max KM', max_km EXPONENT 0 DECIMALS 2 color 7,
           'Max H', max_hr EXPONENT 0 DECIMALS 2 color 7,
           'Max L', max_lit EXPONENT 0 DECIMALS 2 color 7.
    *endat.
             wa_final-max_date = wa_data-idate.
             wa_final-min_date  = wa_data-idate.
             wa_final-max_km  = wa_data-recdv.
             wa_final-min_km  = wa_data-recdv.
             wa_final-max_hR   = wa_data-recdv.
             wa_final-min_hR   = wa_data-recdv.
             wa_final-max_lit  = wa_data-recdv.
             wa_final-min_lit  = wa_data-recdv.
             wa_final-t_max_min_km   = wa_data-recdv.  " min_km - max_km
             wa_final-t_max_min_hr  = wa_data-recdv.   " min_hr - max_hr
             wa_final-t_max_min_lit  = wa_data-recdv.  " min_lit - max_lit.
      IF p_mode = 'A'.
        wa_final-equnr = wa_data-equnr.
        wa_final-eqktx = wa_data-eqktx.
        wa_final-eqfnr = wa_data-eqfnr.
        APPEND wa_final TO i_final.
      ELSE.
        MODIFY i_final FROM wa_final
          TRANSPORTING
              max_date
              min_date
              max_km
              min_km
              max_hr
              min_hr
              max_lit
              min_lit
              t_max_min_km
              t_max_min_hr
              where equnr = wa_data-equnr.
      ENDIF.
    ENDFORM.                    " PREPARE_FINAL_REC
    regards;

    Hi
    Thanks , where to use the loop and endloop.
    I want individual data to go into wa_final but confused how to start to get
    min date..max..date..minkm_value..maxkm_value...total min-max,
    min_hr,max_hr,total diff , min_lit,max_lit, total as in the program but how the data will go according to the values in wa_final
    regards
    Piroz

  • DIFF: Field string ,Structure and Internal table declaration

    Hai,
           what is the diference between  Field string ,Structure in ABAP program and Internal table declaration and how it will work ?
    Thank you
    ASHOK KUMAR.

    hi,
    Look this u will get a good idea.
    *& Report  ZTYPES                                                      *
    REPORT  ZTYPES                                                  .
    * Table declaration (old method)
    DATA: BEGIN OF tab_ekpo OCCURS 0,             "itab with header line
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF tab_ekpo.
    *Table declaration (new method)     "USE THIS WAY!!!
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,      "itab
          wa_ekpo TYPE t_ekpo.                    "work area (header line)
    * Build internal table and work area from existing internal table
    DATA: it_datatab LIKE tab_ekpo OCCURS 0,      "old method
          wa_datatab LIKE LINE OF tab_ekpo.
    * Build internal table and work area from existing internal table,
    * adding additional fields
    TYPES: BEGIN OF t_repdata.
            INCLUDE STRUCTURE tab_ekpo.  "could include EKKO table itself!!
    TYPES: bukrs  TYPE ekpo-werks,
           bstyp  TYPE ekpo-bukrs.
    TYPES: END OF t_repdata.
    DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0,   "itab
          wa_repdata TYPE t_repdata.                 "work area (header line)
    Regards
    Reshma

  • OTF to PDF - Getting blank PDF Internal table with CONVERT_OTF func module

    All
    i've captured OTF from smartforms and tried converting to PDF through 'CONVERT_OTF_2_PDF' FUNCTIOn module and after emailing to external email id, i found logo is completely disturbed (characters in logo got mixed up)..... later i tried converting with ''CONVERT_OTF' function module, but here i'm getting blank PDF internal table....
    what am i missing in both ?
    my intention is converting otf to pdf and emailing...though there are thousands of similar threads are available , none of them are related to my exact problem, which is logo is getting mixed up or disturbed.... any suggestions ?
    Thanks in advance

    Hi,
    You need to use the function module SX_OBJECT_CONVERT_OTF_PDF to create the PDF from OTF ..
    Here is an example program
    report ZPDFPRNT no standard page heading.
    TABLES: TST05.
    DATA: BEGIN OF ITAB OCCURS 0,
       TLINE(255),
    END OF ITAB.
    DATA: BEGIN OF ITAB2 OCCURS 0,
      TLINE(255),
    END OF ITAB2.
    DATA: BEGIN OF ITAB3 OCCURS 0,
      TLINE(255),
    END OF ITAB3.
    DATA: BEGIN OF OTF_TAB OCCURS 0,
      TLINE(255),
    END OF OTF_TAB.
    DATA: LEN_OUT LIKE SOOD-OBJLEN.
    DATA: LEN_IN LIKE SOOD-OBJLEN.
    DATA: BEGIN OF DATA_SET OCCURS 200,
      DATA_LENGTH(5),
      PRECOL(1),
      DATA_LINE(1000),
    END OF DATA_SET.
    DATA: BEGIN OF OTF_PAGE OCCURS 200.
      INCLUDE STRUCTURE ITCOO.
    DATA: END OF OTF_PAGE,
    OTF_PAGES TYPE P,
    OTF_MAX_PAGES TYPE P VALUE 10.
    DATA: BEGIN OF OTF_CONTROL.
      INCLUDE STRUCTURE ITCPP.
    DATA: END OF OTF_CONTROL,
    FORCE_RAW_OTF VALUE ' ',
    L100_EXCLUDE(4) VALUE 'OTFJ',
    BEGIN OF OTF_PAGE_INDEX OCCURS 20,
      LINE_NUM TYPE P,
    END OF OTF_PAGE_INDEX,
    CUR_OTF_PAGE VALUE 1.
    DATA: DATA_SET_LINECOUNT TYPE P,
    DATA_SET_MAX_LINES TYPE P VALUE 100000,
    DATA_SET_VALID TYPE C VALUE ' ',
    DATA_SET_IS_OTF TYPE C VALUE ' ',
    DATA_SET_LENGTH(5) TYPE C,
    LINE_SPECIAL LIKE DATA_SET-DATA_LINE,
    NEED_LINE_SPECIAL TYPE C,
    DSN_TYPE(8) TYPE C.
    DATA: FCODE(4) TYPE C,
    DATE TYPE D,
    TIME TYPE T,
    RC(10) TYPE C,
    ERRMSG(100) TYPE C,
    PRINTJOB_CREATED(1) TYPE C,
    PRINTJOB_CLEARED(1) TYPE C,
    PRINTJOB_LIST(1) TYPE C,
    DISPLAY_MODE(1) TYPE C,
    LINE_MAX TYPE P VALUE '100000',
    NEW_SCREEN_300(1) TYPE C,
    MULTI_PRINT_300(1) TYPE C,
    PRINT_ALL_300(1) TYPE C,
    PRINT_COUNT_300 TYPE I,
    SHOW_USER_100 TYPE C VALUE ' ',
    ERROR_DISPLAY_LEVEL TYPE C VALUE '9',
    NEXT_ERROR_DISPLAY_LEVEL TYPE C,
    PREV_ERROR_DISPLAY_LEVEL TYPE C,
    START_300(5) TYPE C, END_300(5) TYPE C,
    SEP LIKE SY-VLINE,
    DEFAULT_PRI,
    TSP01_BUF LIKE TSP01,
    TSP01_CURLINE LIKE SY-STARO,
    TSP01_CURCOL LIKE SY-CUCOL,
    TSP01_CURROW LIKE SY-CUROW.
    DATA: BEGIN OF DATA_SET_LINE,
      DATA_LENGTH(5),
      PRECOL(1),
    DATA_LINE(1000),
    END OF DATA_SET_LINE.
    DATA: STATUS LIKE SY-SUBRC.
    DATA: WGF_MESSAGE(80).
    DATA: H_PATH(20) TYPE C.
    DATA: H_MASK(20) TYPE C VALUE ',.pdf ,.pdf. '.
    DATA: FILE_NAME(20).
    DATA: FILENAME LIKE RLGRAP-FILENAME.
    DATA: IMPORT(132).
    PARAMETERS: IDENT(5) TYPE C.
    PERFORM GET_OTF_TAB.
    LOOP AT OTF_PAGE.
       OTF_TAB-TLINE = OTF_PAGE.
       APPEND OTF_TAB.
    ENDLOOP.
    CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
    EXPORTING
      FORMAT_SRC = 'OTF'
      FORMAT_DST = 'PDF'
      DEVTYPE = 'ASCIIPRI'
      LEN_IN = LEN_IN
    IMPORTING
      LEN_OUT = LEN_OUT
    TABLES
      CONTENT_IN = OTF_TAB
      CONTENT_OUT = ITAB2
    EXCEPTIONS
      ERR_CONV_FAILED = 1
      OTHERS = 2.
    PERFORM GET_PATH USING 'PDF_FILE'.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      FILENAME = FILENAME
      FILETYPE = 'BIN'
      BIN_FILESIZE = LEN_OUT
    TABLES
      DATA_TAB = ITAB2
    EXCEPTIONS
      FILE_OPEN_ERROR = 1
      FILE_WRITE_ERROR = 2
      INVALID_FILESIZE = 3
      INVALID_TABLE_WIDTH = 4
      INVALID_TYPE = 5
      NO_BATCH = 6
      UNKNOWN_ERROR = 7
      OTHERS = 8.
    *& Form GET_OTF_TAB
    FORM GET_OTF_TAB.
    DATA: PART(4) VALUE '0001',
    BEGIN OF MSG,
      A(40),
      B(40),
      C(40),
    END OF MSG.
    REFRESH DATA_SET.
    DATA_SET_LINECOUNT = 0.
    DATA_SET_IS_OTF = ' '.
    OTF_PAGES = 0.
    REFRESH OTF_PAGE_INDEX.
    CALL 'RSPOACSD'.
    SELECT * FROM TST05 WHERE DTHREAD = 'X'.
    CALL 'RSPOAOSD'
    ID 'ID' FIELD IDENT
    ID 'TYPE' FIELD TST05-DTYPE
    ID 'RECTYP' FIELD 'VYL----'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS = 0.
      DSN_TYPE = TST05-DTYPE.
      IF DSN_TYPE(3) = 'OTF'.
        DATA_SET_IS_OTF = 'X'.
      ENDIF.
    ENDIF.
    IF STATUS <> 24. EXIT. ENDIF.
    ENDSELECT.
    DATA_SET_VALID = 'X'.
    DATA_SET_MAX_LINES = ( LINE_MAX * '1.1' ) + 100.
    DO.
    CLEAR: DATA_SET_LINE, DATA_SET_LENGTH.
    CALL 'RSPOARSD'
    ID 'BUFF' FIELD DATA_SET_LINE+5
    ID 'DATALEN' FIELD DATA_SET_LENGTH
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS = 36.
    WHILE STATUS = 36.
    CALL 'RSPOACSD'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    ADD 1 TO PART.
    IF DATA_SET_IS_OTF = ' '.
    CALL 'RSPOAOSD'
    ID 'ID' FIELD IDENT
    ID 'TYPE' FIELD DSN_TYPE
    ID 'PART' FIELD PART
    ID 'RECTYP' FIELD 'VYL----'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    ELSE.
    CALL 'RSPOAOSD'
    ID 'ID' FIELD IDENT
    ID 'PART' FIELD PART
    ID 'TYPE' FIELD DSN_TYPE
    ID 'RECTYP' FIELD 'VYL----'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    ENDIF.
    IF SY-SUBRC NE 0. EXIT. ENDIF.
    CLEAR: DATA_SET_LINE, DATA_SET_LENGTH.
    CALL 'RSPOARSD'
    ID 'BUFF' FIELD DATA_SET_LINE+5
    ID 'DATALEN' FIELD DATA_SET_LENGTH
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    ENDWHILE.
    ENDIF.
    IF STATUS <> 0 AND STATUS <> 40. EXIT. ENDIF.
    DATA_SET = DATA_SET_LINE.
    IF NOT ( DATA_SET_LENGTH IS INITIAL ).
    DATA_SET-DATA_LENGTH = DATA_SET_LENGTH - 1.
    ENDIF.
    APPEND DATA_SET.
    ADD 1 TO DATA_SET_LINECOUNT.
    IF DATA_SET_IS_OTF = ' '.
    IF DATA_SET_LINECOUNT >= DATA_SET_MAX_LINES.
    CLEAR DATA_SET.
    APPEND DATA_SET.
    MOVE '----
    ' TO DATA_SET-DATA_LINE.
    APPEND DATA_SET.
    CLEAR DATA_SET.
    APPEND DATA_SET.
    WRITE: 'Abbruch nach'(029) TO MSG-A.
    WRITE: DATA_SET_MAX_LINES TO MSG-B.
    WRITE: 'Zeilen.'(030) TO MSG-C.
    CONDENSE MSG.
    DATA_SET-DATA_LINE = MSG.
    APPEND DATA_SET.
    EXIT.
    ENDIF.
    ELSE.
    MOVE DATA_SET_LINE-DATA_LINE TO OTF_PAGE.
    APPEND OTF_PAGE.
    IF OTF_PAGE(2) = 'EP'.
      ADD 1 TO OTF_PAGES.
      IF OTF_PAGES >= OTF_MAX_PAGES.
        MESSAGE S229(PO) WITH OTF_MAX_PAGES.
        EXIT.
      ENDIF.
    ELSEIF OTF_PAGE(2) = 'OP'.
      OTF_PAGE_INDEX-LINE_NUM = DATA_SET_LINECOUNT.
      APPEND OTF_PAGE_INDEX.
    ENDIF.
    ENDIF.
    ENDDO.
    IF STATUS <> 0 AND STATUS <> 12.
      CALL 'RSPOACSD'.
      MESSAGE E112(PO) WITH STATUS RC ERRMSG.
    ENDIF.
    CALL 'RSPOACSD'.
    STATUS = SY-SUBRC.
    IF STATUS <> 0.
      MESSAGE E112(PO) WITH STATUS RC ERRMSG.
    ENDIF.
    ENDFORM. " GET_OTF_TAB
    *& Form GET_PATH
    FORM GET_PATH USING P_FILENAME.
    CLEAR: H_PATH, FILE_NAME.
    FILE_NAME = P_FILENAME.
    CALL FUNCTION 'WS_QUERY'
    EXPORTING
    QUERY = 'CD' "// Current Directory
    IMPORTING
    RETURN = H_PATH.
    CONCATENATE FILE_NAME '.pdf' INTO FILE_NAME.
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
      DEF_FILENAME = FILE_NAME
      DEF_PATH = H_PATH
      MASK = H_MASK
      MODE = 'O'
    IMPORTING
      FILENAME = FILENAME"dbname
    EXCEPTIONS
      INV_WINSYS = 1
      NO_BATCH = 2
      SELECTION_CANCEL = 3
      SELECTION_ERROR = 4
      OTHERS = 5.
    ENDFORM. " GET_PATH
    Regards
    Sudheer

  • Difference between line type and internal table?

    Hi..
    I wanted to know, what is the difference between Line type and Internal Table?

    Hi,
        Before the 4.7 release in SAP if we want to define an internal table we have to write the defination using the occurs statement and we need to define all the fields using INCLUDE STRUCTURE or indidually all the fields ine by one.
    From 4.7 release of R/3 SAP introduced the Line type concept and it's part of the ABAP OOPS concept. for internal table defination we don't need to use the occur statements. Instead INCLUDE structure  we need to create a Line type for that structure in Se11 and then we can define the internal table like :
    DATA : ITAB TYPE TABLE OF <LINE_TYPE>.
    Only thing is this table will be  a table without header. So for internal table processing we need to define a work area structure of type line of line type  . EX:
    DATA: WA_ITAB TYPE LINE OF <LINE_TYPE>.
    Hope this helps.
    Thanks,
    Greetson

  • DATA BASE TABLE AND INTERNAL TABLE

    Dear Friends,
    please help me out in getting complete information about database table and internal table.
    you can email me at < Removed by moderator - please maintain e-mail iDs in Business Card>
    Message was edited by:
            Arun Varadarajan

    Hi Hazi,
    <b>DATABASE Tables :</b>
    This are the tables which are stored in the database (eg Oracle , informix , DB2 etc..) Physically. u can view it from T-codes SE11 or SE16. here in SE11 u can create ur own Transparent table.
    for more information...
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/dictionary_tutorial.html
    <b>Internal Tables.</b>
    While generating reports or other objects we are not modifying the database tables directly first we are selecting the data of the database table into the internal tables... so that we can reduce the database access time and network traffic .. which is highly needed in R/3 system..
    internal tables are not exist phyiscally in the system. its like a array. the existance of the internal tables is upto the program execution in which u r declaring nd using it...
    for more information..
    http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/internaltables_tutorial.html
    Hope it will solve ur problem..
    <b>Reward points if useful..</b>
    Thanks & Regards
    ilesh 24x7

  • I am getting problem with internal table & work area declaration.

    I am working with 'makt' table ..with the table makt i need to work with styles attributes ..so i declared like this
    TYPES : BEGIN OF ty_makt,
             matnr TYPE makt-matnr,
             spras TYPE makt-spras,
             maktx TYPE makt-maktx,
             maktg TYPE makt-maktg,
             celltab TYPE lvc_t_styl,
           END OF ty_makt.
    DATA : i_makt TYPE TABLE OF ty_makt.
    DATA : wa_makt TYPE ty_makt .
        But end of program i need to update dbtable "makt"...i am getting problem with internal table & work area declaration.
    i think makt table fields mapping and internal table/work area mapping is not correct. so please help me to get out from this.

    Hi Nagasankar,
    TYPES : BEGIN OF TY_MATNR,
                  MATNR TYPE MAKT-MATNR,
                  SPRAS TYPE MAKT-SPRAS,
                  MAKTX TYPE MAKT-MAKTX,
                  MAKTX TYPE MAKT-MAKTG,
                  CELLTAB TYPE LVC_T_STYL,  " Its Working perfectly fine..
                 END OF TY_MAKT.
    DATA: IT_MAKT TYPE STANDARD TABLE OF TY_MAKT,
              WA_MAKT TYPE TY_MAKT.
    Its working perfectly fine. if still you are facing any issue post your complete code.
    Thanks,
    Sandeep

  • Getting the final internal table of a transaction VA05

    Hi,
    Can anyone help me in getting the final internal table of a transaction VA05 when called from a program. I need to use to this internal table for further processing.
    Thanks in advance,
    Vinay.

    Hi,
    Not quite sure what you are after but the following may help.
    For a start VA05 uses FM RV_SALES_DOCUMENT_VIEW_3 to select it's data.  Your program could simply call this.  However, if you are doing a CALL TRANSACTION from your program to VA05 and you want to get the results back then you could utilise some 'old style' userexits available in VA05.
    Two choices here:
    1. At the end of FM RV_SALES_DOCUMENT_VIEW_3 there is a form END_MODIFICATION or
    2. When VA05 calls RV_SALES_DOCUMENT_VIEW_3 it performs a user sort MV75AFZ1(MV75AFZ1)
    Both of these belong to package VMOD which means you can modify them by simply registering the object in OSS (these are 'old style' exits before SMOD/CMOD and are prevelant in SD)
    From either of these you could EXPORT to memory for when control is returned back to your program.
    Thanks,
    Pete

  • Difference between work area and internal tables.

    Hi  I wanna know the difference between work area and internal tables.
    what happend if i give with out header line in internal table.
    also how to assosiate work area to internal table in that scenario.

    Hi Balaji..
    The internal table is an ABAP runtime object which has two parts the Body and the header.
    Whereas a work area cannot have a body.. It is mere a field or group of fields which can hold values at runtime..
    In the SAP higher versions mySAP ERP, the use of tables with header line is made obsolete.. But there is absolutely no problem with the same..
    Just think that when you define an internal table with occurs or with header line statement, the system automatically creates a workarea with this table, using which you can access the contents in the bosy of tyhe table.. You can read a record from the table body to this header or add a record in the header to the internal table body..
    When you work with a table ITAB without a header line, you can not use statements like READ TABLE, APPEND, INSERT etc without giving an explicit work area..
    Suppose i have an internal table like:
    DATA : itab TYPE STANDARD TABLE OF t001.
    This table will not have a header with it.
    If you will use APPEND itab. The compilor will give error.
    Here i will create a work area with same structure of the table.
    DATA : e_wa TYPE t001.
    Now i will write:
    APPEND e_wa TO itab.
    READ TABLE itab INTO e_wa WITH KEY xxxxxx
    LOOP AT itab INTO e_wa...           etc..
    In a better approach we use Field symbols with such tables, instead of structures
    FIELD-SYMBOLS: <fs_itab> TYPE t001.
    So,
    LOOP AT itab ASSIGNING <fs_itab>
    READ TABLE itab ASSIGNING <fs_itab> etc.. However we can not use field symbols in few cases..
    I hope this will help you..
    Thanks and Best Regards,
    Vikas Bittera.
    **Points for usefull answers**

  • OMBPlus "Analyze table statements" and "Analyze table sample percentage"

    Hello!
    I want to use OMBPLUS to fetch what properties a mapping have for “Analyze table statements” and “Analyze table sample percentage”.
    I have tried to use OMBRETERIVE MAPPING but I can’t find the right GET PROPERTIES.
    I hope YOU can help me.
    Best regards,
    Tina

    Hi Tina,
    try
    OMBRETRIEVE MAPPING 'MAP_DUMMY' GET PROPERTIES (ANALYZE_TABLE_STATEMENTS)
    OMBRETRIEVE MAPPING 'MAP_DUMMY' GET PROPERTIES (ANALYZE_TABLE_SAMPLE_PERCENTAGE)
    Regards,
    Carsten.

  • Can we apply select statement on internal table.

    can we apply select statement on internal table.if yes thrn let me know how to do.

    Dear Sachin,
    You cannot use SELECT statement on internal table.
    If you want to select some rows from internal table you can LOOP the table or you can READ the table.
    <u>Please check the following links for your kind reference:</u>
    <b>http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm
    http://www.sap-img.com/ab009.htm
    http://www.itsmarc.com/crs/Clas0302.htm
    http://www.sapdevelopment.co.uk/tips/tips_itab.htm
    http://searchsap.techtarget.com/search/1,293876,sid21,00.html?query=whatisinternaltable&bucket=ALL</b>
    Cheers !
    Moqeeth.

  • Export - Import In ABAP ( for variables and internal table)

    how can we pass value for the variable and internal table using Export and Import?
    data: var type sy-uzeit.
    var = sy-uzeit.
    EXPORT var TO MEMORY ID 'TIME'.
    data: var type sy-uzeit.
    IMPORT var FROM MEMORY ID 'TIME'.
    write:/ var,sy-subrc,sy-uzeit.
    i found var value 0 while importing. 
    what is the right syntax for passing value of variable and internaltable.
    regards,
    dushyant.

    Hi,
    There are two possible solutions.
    Solution1:
    Program1.Should be run before atleast once so that TIME should be filled.
    data: var type sy-uzeit.
    var = sy-uzeit.
    EXPORT var TO MEMORY ID 'TIME'.
    Program2.IF the TIME is filled,then only it will produce the result.
    data: var type sy-uzeit.
    clear var.
    IMPORT var FROM MEMORY ID 'TIME'.
    write:/ var, sy-subrc, sy-uzeit.
    Solution2:
    Single program:
    data: var type sy-uzeit.
    var = sy-uzeit.
    EXPORT var TO MEMORY ID 'TIME'.
    clear var.
    IMPORT var FROM MEMORY ID 'TIME'.
    write:/ var, sy-subrc, sy-uzeit.
    Kindly reward points by clikcing the star on the left of reply,if it helps.

Maybe you are looking for

  • Best way to index portal content

    Hi all, I am searching for a nice way to index the content of the portal. Using the standard functionality (http://help.sap.com/saphelp_nw70ehp1/helpdata/en/46/9d1405fa743ef0e10000000a1553f7/frameset.htm) does not lead to sufficient results, since al

  • WRT54GS Changeover from Wired to Wireless (Vista): Duck Soup!

    I've owned my WRT54GS router for nearly three years and had initially bought it as a wired router (with an option to go secured wireless later), but I'm used to thinking that wireless was primarily for laptops and notebooks (even though I've actually

  • Why can't I get my program to compile?

    I'm very new to this, taking a class now, and I can't seem to get anything to work. I downloaded 1.4.1 and changed the path and so forth. At first, it didn't recognize javac, now it's saying it can't read the file on the disk. I have windows XP home

  • Calendar Widget in Notification not updated with shared calendar

    Greetings---I'm on OS X Yosemite 10.10.1 and have a Google Calendar shared with me that I would like to appear in the notification pane. It seems, however, that the Calendar widget in Notifications only updates with events that are local to iCalendar

  • Values in the form vanishing when sorting in grid

    Hi experts, I am using Entity based VO, The VO contains some 15 columns, I am showing 10 columns in the af:table grid and the rest are out of the grid uses normal binding of the same VO. I am having those columns in formlayout. Issue : when I select