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

Similar Messages

  • 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

  • Get the Common from Two Internal Tables with same structure

    Hi ,
    I need to get the Common data from Two Internal Tables with same structure with using the looping method.
    For e.g.
    I have two internal table say ITAB1 and ITAB2.
    ITAB1 has values A,B,C,D,E,F
    ITAB2 has values A,H,B,Y,O
    Output at runtime should be : A,B

    Hi mohit,
    1. If u want to compare all fields,
       for matching purpose,
       then we can do like this.
    2.
    report abc.
    data : a like t001 occurs 0 with header line.
    data : b like t001 occurs 0 with header line.
    loop at a.
      LOOP AT B.
        IF A = B.
          WRITE :/ 'SAME'.
        ENDIF.
      endloop.
    ENDLOOP.
    regards,
    amit m.

  • How to get the final internal table after the ALV is modified?

    Dear experts,
    My WebDynpro application allows users to delete row, sort the column. After all this modification, I need to get the final internal table of ALV to generate a csv.file. Are there any methods to get the final interal table content of ALV?
    Many thanks!
    meer

    Hi Friend  ,
    Please see this  link for wiki of  WDA Alv Hierarchy : [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f&overridelayout=true]
    Regards,

  • 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

  • Getting error of Defining an internal table with header line, SELECT-OPTIO

    Hi all,
    i have a coding for my smart form,In this coding i have define an structure which being used,but when i execute it it give me
    error of Defining an internal table with header line, SELECT-OPTIONS, and RANGES is not allowed within a structure.Even tough you can see that in  my coding im not using SELECT-OPTION or RANGES,but can't understand why it gives me this error.
    Following are the code:
      DATA: BEGIN OF traptab OCCURS 50.
            INCLUDE STRUCTURE mseg.
      DATA: vgart LIKE mkpf-vgart,
            blart LIKE mkpf-blart,
            blaum LIKE mkpf-blaum,
            bldat LIKE mkpf-bldat,
            budat LIKE mkpf-budat,
            cpudt LIKE mkpf-cpudt,
            cputm LIKE mkpf-cputm,
            aedat LIKE mkpf-aedat,
            usnam LIKE mkpf-usnam,
            tcode LIKE mkpf-tcode,
            xblnr LIKE mkpf-xblnr,
            bktxt LIKE mkpf-bktxt,
            frath LIKE mkpf-frath,
            frbnr LIKE mkpf-frbnr,
            wever LIKE mkpf-wever,
          END OF traptab. 
    Thanks & Regards,
    sappk25

    thanks

  • How to fill internal table with no data in debugging mode

    Hi all,
             I modified one existing program.Now I want to test it.I am not given test data.So in the middle of my debugging, I found that one internal table with no data.My problem is how to fill that internal table with few records in that debugging mode just as we change contents in debugging mode.If I want to proceed further means that internal table must have some records.
    Please I dont know how to create test data so I am trying to create values temporarily in debugging mode only.
    Thanks,
    Balaji

    Hi,
    In the debugging do the following..
    Click the Table button..
    Double click on the internal table name..
    Then in the bottom of the screen you will get the buttons like CHANGE, INSERT, APPEND, DELETE..
    Use the APPEND button to insert records to the internal table..
    Thanks,
    Naren

  • How to pass internal table with data in ABAP OO

    Hi experts ,
    Here is the problem...
    I create a screen 100 and use the internal table to get data from database, and then press the button on screen 100 , it will call screen 200.
    I use ABAP OO code in screen 200, and i want to keep the internal table with data that i get from the sceen 100 parts, but it seems that it just supports to create a new internal table and get data from database in ABAP OO. That means i need to create a new table to save the data in internal table ? Or there is any other solution something like exporting or memory id ...
    ps . the internal table in screen 100 is declared in global area, the beginning of the code.
    Please give me some advice, thanks a lot!
    Regards ,
    Claire

    I have already know how to do, here is my code:
    METHODS fill_tree importing itab2 like itab1.
    CALL METHOD: me->fill_tree exporting itab2 = itab1.
    In METHOD fill_tree,
    declare
    data: itab3 TYPE STANDARD TABLE OF itab,
    itab3[] = itab1[].
    It is useful to me, thanks a lot.

  • Internal table with Import and Export

    Hi All,
    Hi all
    Please let me know the use of <b>Internal table with Import and Export parameters and SET/GET parameters</b>, on what type of cases we can use these? Plese give me the syntax with some examples.
    Please give me detailed analysis on the above.
    Regards,
    Prabhu

    Hi Prabhakar,
    There are three types of memories.
    1. ABAP MEMORY
    2. SAP MEMORY
    3. EXTERNAL MEMORY.
    1.we will use EXPORT/ IMPORT TO/ FROM MEMORY-ID when we want to transfer between ABAP memory
    2. we will use GET PARAMETER ID/ SET PARAMETER ID to transfer between SAP MEMORY
    3. we will use EXPORT/IMPORT TO/FROM SHARED BUFFER to transfer between external memory.
    ABAP MEMORY : we can say that two reports in the same session will be in ABAP MEMORY
    SAP MEMORY: TWO DIFFERENT SESSIONS WILL BE IN SAP MEMORY.
    for ex: IF WE CALL TWO DIFFERENT TRANSACTIONS SE38, SE11
    then they both are in SAP MEMORY.
    EXTERNAL MEMORY: TWO different logons will be in EXTERNAL MEMORY.
    <b>Syntax</b>
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETER statements.
    To fill one, use:
    SET PARAMETER ID <pid> FIELD <f>.
    This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID <pid> FIELD <f>.
    This statement fills the value stored under the ID <pid> into the variable <f>. If the system does not find a value for <pid> in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.
    To fill the initial screen of a program using SPA/GPA parameters, you normally only need the SET PARAMETER statement.
    The relevant fields must each be linked to an SPA/GPA parameter.
    On a selection screen, you link fields to parameters using the MEMORY ID addition in the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID when you declare a parameter or selection option, the corresponding input field is linked to that input field.
    On a screen, you link fields to parameters in the Screen Painter. When you define the field attributes of an input field, you can enter the name of an SPA/GPA parameter in the Parameter ID field in the screen attributes. The SET parameter and GET parameter checkboxes allow you to specify whether the field should be filled from the corresponding SPA/GPA parameter in the PBO event, and whether the SPA/GPA parameter should be filled with the value from the screen in the PAI event.
    When an input field is linked to an SPA/GPA parameter, it is initialized with the current value of the parameter each time the screen is displayed. This is the reason why fields on screens in the R/3 System often already contain values when you call them more than once.
    When you call programs, you can use SPA/GPA parameters with no additional programming overhead if, for example, you need to fill obligatory fields on the initial screen of the called program. The system simply transfers the values from the parameters into the input fields of the called program.
    However, you can control the contents of the parameters from your program by using the SET PARAMETER statement before the actual program call. This technique is particularly useful if you want to skip the initial screen of the called program and that screen contains obligatory fields.
    Reading Data Objects from Memory
    To read data objects from ABAP memory into an ABAP program, use the following statement:
    Syntax
    IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.
    This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO <g i > option, the data object <f i > in memory is assigned to the data object in the program with the same name. If you do use the option, the data object <f i > is read from memory into the field <g i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    You do not have to read all of the objects stored under a particular name <key>. You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC is always 0, regardless of whether it contained the data object <f i >. If the cluster does not contain the data object <f i >, the target field remains unchanged.
    Saving Data Objects in Memory
    To read data objects from an ABAP program into ABAP memory, use the following statement:
    Syntax
    EXPORT <f1> [FROM <g 1>] <f 2> [FROM <g 2>] ... TO MEMORY ID <key>.
    This statement stores the data objects specified in the list as a cluster in memory. If you do not use the option FROM <f i >, the data object <f i > is saved under its own name. If you use the FROM <g i > option, the data objet <g i > is saved under the name <f i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    Check this link.
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    Thanks,
    Susmitha.
    Reward points for helpful answers.

  • Import from database an internal table with generic Type : Web Dynpro ABAP

    Hi everyone,
    i have a requirement in which i'm asked to transfer data flow between two frameworks, from WD Component to another. The problem is that i have to transfer internal tables with generic types. i used the import/ export from database approache but in that way i get an error message saying "Object references and data references not yet supported".
    Here is my code to extract a generic internal table from memory.
        DATA l_table_f4 TYPE TABLE OF REF TO data.
      FIELD-SYMBOLS: <l_table_f4> TYPE STANDARD TABLE.
      DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
      DATA: ls_indx TYPE indx.
      lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
      lo_componentcontroller->fire_vh_search_action_evt( ).
      ASSIGN l_table_f4 TO <l_table_f4>.
    *-- Import table for Help F4
      IMPORT l_table_f4 TO <l_table_f4> FROM DATABASE indx(v1) TO ls_indx ID 'table_help_f4_ID'.
    The error message is desplayed when last instruction is executed " IMPORT l_table_f4...".
    I saw another post facing the same problem but never solved "Generic Type for import Database".
    Please can anyone help ?
    Thanks & Kind regards.

    hi KIan,
    go:
    general type
    TYPE : BEGIN OF ty_itab,
               field1 TYPE ztab-field1,
               field2 TYPE ztab-field2,
    *your own fields here:
               field TYPE i,
               field(30) TYPE c,
               END OF ty_itab.
    work area
    DATA : gw_itab TYPE ty_itab.
    internal table
    DATA : gt_itab TYPE TABLE OF ty_itab.
    hope this helps
    ec

  • Dynamic internal table with dynamic header

    Hi Members,
    I have created a dynamic report ie In the selection screen i will give set of GL accounts.
    Based on the GL it will separate a col like Sales GL, PF GL , Discount Gl etc. In the header portion  first 3 col is constant ie it  will show the vendor name and material and text remaining col is based on the GL entered in the screen it will cumulate the Total Amount and display accordingly.
    This is working fine in ALV grid display, but i required to download the data to excel , while downloading to excel i am getting only the values without header,
    ie title of the each col not getting . kindly guide me to solve this issue.
    If i entered only sales GLs (100,101,102 ) then  my output should be
    vendor   material    mateial text   100       101      102
    ddddd    11100       Raw salt      2000    1000     2500
    Regards,
    Mee.S

    Hi Meenakshi,
    As per my knowledge two ways of doing it...
    1. when u get the final internal table..check for the fields with not initial...again update the header internal table dynamically..
    2. if you get GL or PF or any such thing you can hardcode the header and display it on to excel..
    Regards,
    Vamshi

  • Internal table with Dynamic and Non dynamic fileds

    Hi Experts,
    How to get the internal table with Dynamic and Non-Dynamic Fields.
    Could u please help me.
    Thanks,
    Varun

    Hi,
       Execute the below sample code or analyze it there is appropriate description provided.
    *& Report  ZTEST_PRM_DYN_ALV
    REPORT  ZTEST_PRM_DYN_ALV.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
    <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
    it_fldcat type lvc_t_fcat.
    selection-screen begin of block b1 with frame title text-001.
    parameters: p_flds(5) type c.
    selection-screen end of block b1.
    start-of-selection.
    *build the dynamic internal table
    perform build_dyn_itab.
    *write 5 records to the alv grid
    do 5 times.
    perform build_report.
    enddo.
    *call the alv grid.
    perform call_alv.
    *Build_dyn_itab
    form build_dyn_itab.
    data: new_table type ref to data,
    new_line type ref to data,
    wa_it_fldcat type lvc_s_fcat.
    *Create fields .
    clear wa_it_fldcat.
    wa_it_fldcat-fieldname = 'name1'.
    wa_it_fldcat-datatype = 'mara-matnr'.
    wa_it_fldcat-intlen = 5.
    append wa_it_fldcat to it_fldcat .
    *clear wa_it_fldcat.
    wa_it_fldcat-fieldname = sy-index.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-intlen = 5.
    append wa_it_fldcat to it_fldcat .
    do p_flds times.
    clear wa_it_fldcat.
    wa_it_fldcat-fieldname = sy-index.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-intlen = 6.
    append wa_it_fldcat to it_fldcat .
    enddo.
    *Create dynamic internal table and assign to FS
    call method cl_alv_table_create=>create_dynamic_table
    exporting
    it_fieldcatalog = it_fldcat
    importing
    ep_table = new_table.
    assign new_table->* to <dyn_table>.
    *Create dynamic work area and assign to FS
    create data new_line like line of <dyn_table>.
    assign new_line->* to <dyn_wa>.
    endform.
    *Form build_report
    form build_report.
    data: fieldname(20) type c.
    data: fieldvalue(5) type c.
    data: index(3) type c.
    field-symbols: <fs1>.
    do p_flds times.
    index = sy-index.
    *Set up fieldvalue
    concatenate 'FLD' index into
    fieldvalue.
    condense fieldvalue no-gaps.
    assign component index of structure <dyn_wa> to <fs1>.
    <fs1> = fieldvalue.
    enddo.
    *Append to the dynamic internal table
    append <dyn_wa> to <dyn_table>.
    endform.
    *CALL_ALV
    form call_alv.
    data: wa_cat like line of alv_fldcat.
    *clear wa_cat.
    wa_cat-fieldname = 'matnr'.
    wa_cat-seltext_s = sy-index.
    wa_cat-outputlen = '10'.
    append wa_cat to alv_fldcat.
    do p_flds times.
    clear wa_cat.
    wa_cat-fieldname = sy-index.
    wa_cat-seltext_s = sy-index.
    wa_cat-outputlen = '6'.
    append wa_cat to alv_fldcat.
    enddo.
    *Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    it_fieldcat = alv_fldcat
    tables
    t_outtab = <dyn_table>.
    endform.
    Hope this will help, reward if found usefull.
    Cheers,
    Ram.

  • Internal table with variable no of columns

    Hi All,
    I have to create an internal table with some fixed columns and rest of the table should be dynamic. The total no of columns depends on a field of some other table. hence, the number of columns of the table are unknown. How to create such a table.
    Thanks,
    Neha

    Execute this program .. we will get a fair idea about how the dyanmic column are populated in the table. Based on that u can write ur sceond table with 92 columns
    *& Report  ZTEST009
    REPORT  ztest009 NO STANDARD PAGE HEADING LINE-SIZE 60 LINE-COUNT 2(1).
    TYPE-POOLS : slis.
    TYPES : BEGIN OF internal,
            matnr(18),
            werks(4),
            qtyn(20),
            desc(20) TYPE c,
            qty TYPE i,
            END OF internal.
    DATA : it TYPE TABLE OF internal,
           wa TYPE internal.
    DATA : fieldcat  TYPE lvc_t_fcat,
           lcat      TYPE lvc_s_fcat,
           final_cat TYPE slis_t_fieldcat_alv,
           fcat      TYPE slis_fieldcat_alv,
           top       TYPE slis_t_listheader,
           events    TYPE slis_t_event,
           layout    TYPE slis_layout_alv.
    DATA : newfield  TYPE REF TO data,
           newdata   TYPE REF TO data.
    FIELD-SYMBOLS : <fs1>,
                    <dynamic_value>,
                    <dynamic_cat> TYPE STANDARD TABLE.
    START-OF-SELECTION.
      PERFORM popudate.
      PERFORM buildcat.
      PERFORM loadata.
      PERFORM events USING events.
      PERFORM header USING top.
      PERFORM layout.
    END-OF-SELECTION.
      PERFORM display.
    *&      Form  popudate
          text
    -->  p1        text
    <--  p2        text
    FORM popudate .
      DEFINE popu.
        wa-matnr = &1.
        wa-werks = &2.
        wa-qtyn = &3.
        wa-desc = &4.
        wa-qty = &5.
        append wa to it.
        clear wa.
      END-OF-DEFINITION.
      popu 'material1' 'pla1' 'QTY1' 'quantity1' 100.
      popu 'material1' 'pla1' 'QTY2' 'quantity2' 200.
      popu 'material1' 'pla1' 'QTY3' 'quantity3' 300.
      popu 'material2' 'pla2' 'QTY1' 'quantity1' 400.
      popu 'material2' 'pla2' 'QTY2' 'quantity2' 500.
      popu 'material2' 'pla2' 'QTY3' 'quantity3' 600.
      popu 'material3' 'pla3' 'QTY1' 'quantity1' 700.
      popu 'material3' 'pla3' 'QTY2' 'quantity2' 400.
      SORT it BY matnr.
    ENDFORM.                    " popudate
    *&      Form  buildcat
          text
    -->  p1        text
    <--  p2        text
    FORM buildcat .
      lcat-fieldname = 'MATNR'.
      lcat-datatype = 'CHAR'.
      lcat-seltext = 'Material'.
      lcat-intlen = 18.
      APPEND lcat TO fieldcat.
      CLEAR lcat.
      lcat-fieldname = 'WERKS'.
      lcat-datatype = 'CHAR'.
      lcat-seltext = 'Plant'.
      lcat-intlen = 4.
      APPEND lcat TO fieldcat.
      CLEAR lcat.
      LOOP AT it INTO wa.
        READ TABLE fieldcat INTO lcat WITH KEY fieldname = wa-qtyn.
        IF sy-subrc <> 0.
          lcat-fieldname = wa-qtyn.
          lcat-datatype = 'CHAR'.
          lcat-seltext = wa-desc.
          lcat-intlen = 10.
          APPEND lcat TO fieldcat.
          CLEAR lcat.
        ENDIF.
      ENDLOOP.
      CLEAR lcat.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
       i_style_table             =
          it_fieldcatalog           = fieldcat
       i_length_in_byte          =
        IMPORTING
          ep_table                  = newfield
       e_style_fname             =
    EXCEPTIONS
       generate_subpool_dir_full = 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.
      ASSIGN newfield->* TO <dynamic_cat>.
      CREATE DATA newdata LIKE LINE OF <dynamic_cat>.
      ASSIGN newdata->* TO <dynamic_value>.
    ENDFORM.                    " buildcat
    *&      Form   loadata
          text
    -->  p1        text
    <--  p2        text
    FORM  loadata .
      DATA flag TYPE i.
      LOOP AT it INTO wa.
        flag = 0.
        ASSIGN COMPONENT 'MATNR' OF STRUCTURE <dynamic_value> TO <fs1>.
        <fs1> = wa-matnr.
        ASSIGN COMPONENT 'WERKS' OF STRUCTURE <dynamic_value> TO <fs1>.
        <fs1> = wa-werks.
        CALL FUNCTION 'AIPC_CONVERT_TO_UPPERCASE'
          EXPORTING
            i_input  = wa-qtyn
            i_langu  = sy-langu
          IMPORTING
            e_output = wa-qtyn.
        ASSIGN COMPONENT wa-qtyn OF STRUCTURE <dynamic_value> TO <fs1>.
        <fs1> = wa-qty.
        AT END OF matnr.
          APPEND <dynamic_value> TO <dynamic_cat>.
          CLEAR : <dynamic_value>.
        ENDAT.
        CLEAR : wa.
      ENDLOOP.
    ENDFORM.                    "  loadata
    **&      Form  display
          text
    -->  p1        text
    <--  p2        text
    FORM display .
      LOOP AT fieldcat INTO lcat.
        fcat-fieldname = lcat-fieldname.
        fcat-outputlen = lcat-intlen.
        fcat-seltext_l = lcat-seltext.
        APPEND fcat TO final_cat.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         i_callback_program             = sy-repid
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
         is_layout                      = layout
         it_fieldcat                    = final_cat
      IT_SORT                        =
      I_SAVE                         = ' '
      IS_VARIANT                     =
         it_events                      = events
        TABLES
          t_outtab                       = <dynamic_cat>
    ENDFORM.                    " display
    Regards,
    Aswin.

  • Text in internal table with HTML tags.

    Hi ,
    I have Text in internal table with HTML tags.
    The text has to be shown in output of smartform as formatted text.
    That is the smartform should READ the HTML TAGS , convert the text accordingly and show in the output as formatted text.
    I dont want to make a webform . This is for NORMAL SPOOL output and NOT for WEB OUTPUT.
    IN SHORT
    :- the text in the internal table is like this ( please ignore the dot in the HTML TAG )--
    <html><.U>this is heading</.U>Line with no break<.br>some content text</.br>
    </html>
    OUTPUT
    <U>this is heading</U>Line with no break<br>some content text</br>
    1)  Can I can get the output and store it as text in a string variable and show in the smartform  ?
    In this case I want to know how to convert  and store in a variable  in sap .
    OR
    2) Can the text element convert the text with HTML TAGS to html formatted output and show it ?
    Regards,
    Jagat

    Hi,
    Use the FM SCP_REPLACE_STRANGE_CHARS and check
    See the
    Converting html special characters to plain characters (e.g. u00FC to u00FC)

  • How to sort an internal table with a header line?

    hi all,
    i have declared table i_bseg type standard table of bseg with header line.
    now i have populated data in i_bseg.
    now i am sorting it by bukrs
    ie i am writing sort i_bseg by bukrs.
    before sorting all i_bseg-belnrs were populated...
    but after sorting the contents of  the i_bseg is changing.
    some of the belnrs are getting deleted..
    is there any special way to sort an internal table with header line...?

    hi,
    <b>SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE].</b>
    The statement sorts the internal table <itab> in ascending order by its key.<b> The statement always applies to the table itself, not to the header line</b>.
    If you have an internal table with a structured line type that you want sort by a different key, you can specify the key in the SORT statement:
    SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE]
                 BY <f1> [ASCENDING|DESCENDING] [AS TEXT]
                    <fn> [ASCENDING|DESCENDING] [AS TEXT].
    <b>this is your sort statement:  sort i_bseg by bukrs.
    you try with this statement:  sort i_bseg by bukrs STABLE.</b>
    regards,
    Ashokreddy

Maybe you are looking for

  • Was wondering if the iphone 4s supports hd voice on telstra? wb-amr i think its called does it have stereo speakers as well?

    does anyone know if the new iphone 4s has wb-amr hd voice support.and wether or not it will be a 4g phone on telstras new network in australia.does it come with stereo speakers this time round?

  • Heterogeneous services with MS EXCEl

    Hi all! I have cofigure heterogeneous services for ORACLE and MS EXCEL. but the operation like UPDATE, INSERT , DELETE are not working. How can i get i right? rana adnan

  • PPTP VPDN and Cisco Client errors

    Hello there, i have configured a cisco 1841 router as a vpn server for microsoft pptp client access. When connecting outside my local lan it hangs at verifying username and password then gives me error 619 message "remote computer did not respond so

  • Dynamic Proxies vs. Generated Code

    I've seen reference a couple times here about stub serialization issues in WebLogic implementations that use dynamic proxies for the stubs. It sounds like recent WebLogic versions have switched back to generated code. Is this the case? If so, I thoug

  • Change White Text to Black

    I've been googling to find a solution to a basic problem and cannot believe what I'm reading. The issue is white text/white background in the text messaging app. I NEED to change the text color from white to black and cannot believe this is not possi