FB_CONVERT_FORM_TO_XML ?

hello all SDNers,
FM FB_CONVERT_FORM_TO_XML , for example ,import parameter->I_FORMNAME =
'SF_EXAMPLE_01', then Export parameter->E_XML of type XSTRING , what's that
export XML? How can i use this export?  can you give me some tips? 
thanks in advance
Yaning

Hi yaning,
1. this will generate the XML file for this.
2.  just copy paste.
REPORT ABC.
data : x type xstring.
data : begin of itab occurs 0,
       f(100) type c,
       end of itab.
data : xml type string.
CALL FUNCTION 'FB_CONVERT_FORM_TO_XML'
  EXPORTING
    I_FORMNAME             = 'SF_EXAMPLE_01'
IMPORTING
   E_XML                  = x
EXCEPTIONS
   NO_NAME                = 1
   NO_FORM                = 2
   NO_ACTIVE_SOURCE       = 3
   CONVERSION_ERROR       = 4
   ILLEGAL_FORMTYPE       = 5
   GENERATION_ERROR       = 6
   OTHERS                 = 7
CALL FUNCTION 'LXE_COMMON_XSTRING_TO_STRING'
  EXPORTING
    IN_XSTRING        = x
  IN_CODEPAGE       = '4110'
  EX_CODEPAGE       = '0000'
IMPORTING
   EX_STRING         = xml
EXCEPTIONS
  ERROR             = 1
  OTHERS            = 2
XML
CALL TRANSFORMATION ('ID')
SOURCE tab = itab[]
RESULT XML xml.
Convert to TABLE
CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
EXPORTING
i_string = xml
i_tabline_length = 100
TABLES
et_table = itab.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
  BIN_FILESIZE                    =
    FILENAME                        = 'd:\aa.xml'
   FILETYPE                        = 'BIN'
  TABLES
    DATA_TAB                        = itab
regards,
amit m.

Similar Messages

  • Problem in FM FB_CONVERT_FORM_TO_XML

    Hello every SDNer,
    I wanna convert a smartform to a Xml-file with FM FB_CONVERT_FORM_TO_XML. The smartform is 'SF_EXAMPLE_01', but the XML-file has always error. who can help me, to find the problem. the code as following.
    regards
    Thanks in advance
    REPORT  ZYLITEST1.
    data : x type xstring.
    data : begin of itab occurs 0,
            f(100) type c,
           end of itab.
    data : xml type string.
    CALL FUNCTION 'FB_CONVERT_FORM_TO_XML'
    EXPORTING
      I_FORMNAME = 'SF_EXAMPLE_01'
    IMPORTING
      E_XML = x
    EXCEPTIONS
      NO_NAME = 1
      NO_FORM = 2
      NO_ACTIVE_SOURCE = 3
      CONVERSION_ERROR = 4
      ILLEGAL_FORMTYPE = 5
      GENERATION_ERROR = 6
      OTHERS = 7
    CALL FUNCTION 'NLS_STRING_CONVERT_TO_SYS'
      EXPORTING
        LANG_USED                   = 'E'
        SOURCE                      = x
      FROM_FE                     = 'MS '
      IMPORTING
        RESULT                      = xml
      SUBSTED                     =
      EXCEPTIONS
        ILLEGAL_SYST_CODEPAGE       = 1
        NO_FE_CODEPAGE_FOUND        = 2
        COULD_NOT_CONVERT           = 3
        OTHERS                      = 4.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'SOTR_SERV_STRING_TO_TABLE'
      EXPORTING
        TEXT                      = xml
        FLAG_NO_LINE_BREAKS       = ' '
      LINE_LENGTH               =
      LANGU                     = SY-LANGU
      TABLES
        TEXT_TAB                  = itab
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = 'c:\aa.xml'
        FILETYPE                        = 'ASC'
      APPEND                          = ' '
        WRITE_FIELD_SEPARATOR           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
        WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = itab
      FIELDNAMES                      =
      EXCEPTIONS
        FILE_WRITE_ERROR                = 1
        NO_BATCH                        = 2
        GUI_REFUSE_FILETRANSFER         = 3
        INVALID_TYPE                    = 4
        NO_AUTHORITY                    = 5
        UNKNOWN_ERROR                   = 6
        HEADER_NOT_ALLOWED              = 7
        SEPARATOR_NOT_ALLOWED           = 8
        FILESIZE_NOT_ALLOWED            = 9
        HEADER_TOO_LONG                 = 10
        DP_ERROR_CREATE                 = 11
        DP_ERROR_SEND                   = 12
        DP_ERROR_WRITE                  = 13
        UNKNOWN_DP_ERROR                = 14
        ACCESS_DENIED                   = 15
        DP_OUT_OF_MEMORY                = 16
        DISK_FULL                       = 17
        DP_TIMEOUT                      = 18
        FILE_NOT_FOUND                  = 19
        DATAPROVIDER_EXCEPTION          = 20
        CONTROL_FLUSH_ERROR             = 21
        OTHERS                          = 22
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    incorporate these changes.
    after the call of 'FB_CONVERT_FORM_TO_XML' remove all other function calls except gui download
    and use the following code
    data: dtab type standard table of solix.
    data: filelength type i .
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer                = X " variable holding xml in xstring
      TABLES
        binary_tab            = dtab .
    filelength = xstrlen( X ) .
    now use dtab in gui_download and the file type has to be BIN and pass filelength .
    Regards
    Raja

  • - Sapscript output convert to XML -

    Hi Gurus,
    I need to convert sapscript output with values - not template - to an XML File or txt.
    i tried RSTXSCRP program and FB_CONVERT_FORM_TO_XML function module but doesn't help me.
    Please help me with the solution.
    Regards
    Emre.
    Edited by: emre karakurum on May 21, 2010 11:38 AM

    In my opinion, SAPScript form is something quite unstructured - the layout of it can be very complicated and as well containing graphic and so on. XML is, on the other side, something pretty structured. I don't think that you can find something standard for simple conversion SAPScript to XML. SAPScript is simply not like IDOC - it's human readable layout rather than strucutre of data. You will have to write your own print-program which will create your own XML file instead of printing SAPScript form. The logic how to structure the XML file (which tags will be there and which values) will be coded in this print-program.

  • Smartforms - how to use page URL like output option ?

    Hello,
    in the smartofms output options, there's the possibility to set
    BSP Page/URL: ......
    and Output format:  XSF output + HTML.
    My requisite is to send a form in XML via web service, can I use it ? How is run ?
    tks.

    Hello
    Use the function module "FB_CONVERT_FORM_TO_XML" to convert the smartform to XML format table.
    The function module has been used in the method "GET_SMART_FORM_AS_XML" of the class .
    THanks ,
    M.Naveen Kumar

  • Smartform xml output

    Hello Frnds,
    Actually I want to store the output of the smartformx xml output in a file.
    I am able to see it in spool ... but how to get it into a file ?
    How & where to ser port type FILE.
    Thanks & Regards

    Hi ,
    Check this thread, may be it helps you
    xml output from smartforms
    smartform output
    Re: FB_CONVERT_FORM_TO_XML ?
    Re: XML OUTPUT
    http://help.sap.com/saphelp_nw04/helpdata/en/6c/28923c114011d5b675006094192fe3/frameset.htm
    Regards,
    Raghav
    Message was edited by:
            Raghavendra  L

Maybe you are looking for

  • Questions about OC and upgrading my 790FX-GD70

    Hey Guys, So Ive had this board for a while now (790FX-GD70) and am looking to throw some new parts on it, I want to throw the 1100T CPU on there (Unless MSI wisens up and enables AM3+ like they did for other boards) and was to throw in some 1600 or

  • This makes no sense - Can't switch phone?

    There's a bit of history behind this so to get proper context here's what has happened so far 1) After 14 months, my original moto droid died so VZW sent me a replacement pre-owned....that didn't work. They then sent another one.....that also didn't

  • Windows Vista Service Pack 2 Incompatible Issue

    Hello, as I was installing vista sp2 and got an message incompatible problem with drivers and please refer to KB 967752. on the first time, I continued to install sp2, but system got blue screen and crashed. On the second time, i installed the hotfix

  • How to change the search provider when using the Firefox Home Button Search feature?

    In Firefox itself I have configured duckduckgo as my default search provider. But when I use the Firefox Home Button Search it is always set to google and I do not see any option to change that? I like the Firefox Home Button Search (or whatever it's

  • BAPI or RFC to simulate an FI invoice creation

    Hi, I need to develop an RFC or BAPI that acts as the SIMULATE function of the transaction FB01 (invoice creation). Could you recommend any tips (es. standard BAPI, Function Modules, etc.) ? Thank you very much in advance. Best Regards. Mauro