Forms in function module

Hello,
I am new to ABAP and i am trying to loop through one table and make another table if certain fields match. Here is my code. It does not work Any help would be greatly appreciated.
FUNCTION Z_ORGBUILDER_CONN.
""Local interface:
*"  IMPORTING
*"     VALUE(OTYPE) LIKE  OBJEC-OTYPE
*"     VALUE(OBJID) LIKE  OBJEC-OBJID
*"     VALUE(PATHID) LIKE  GDSTR-WEGID
*"     VALUE(PLVAR) LIKE  OBJEC-PLVAR
*"  EXPORTING
*"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
*"  TABLES
*"      L_ZCONN_TAB TYPE  ZCONN_TAB
*"      RESULT_TAB STRUCTURE  SWHACTOR OPTIONAL
*"      RESULT_OBJEC STRUCTURE  OBJEC OPTIONAL
*"      RESULT_STRUC STRUCTURE  STRUC OPTIONAL
*"      L_ZCONN_TAB1 TYPE  ZCONN_TAB
DATA: z_struc type zconn_struc.
DATA: OBJectID type struc-objid.
DATA: pointer type struc-pup.
CALL FUNCTION 'RH_STRUC_GET'
         EXPORTING
              act_otype      = otype
              act_objid      = objid
              act_plvar      = plvar
              act_wegid      = pathid
         TABLES
              result_tab       = result_tab
              result_struc     = result_struc
              result_objec     = result_objec
         EXCEPTIONS
              no_plvar_found = 1
              no_entry_found = 2
              OTHERS         = 3.
    IF sy-subrc <> 0.
      RAISE no_roots_found.
    ENDIF.
LOOP AT result_struc.
      z_struc-objectID = result_struc-OBJID.
      z_struc-pointer = result_struc-PUP.
      Append z_struc to l_zconn_tab.
    ENDLOOP.
LOOP AT l_zconn_tab.
      objectid = l_zconn_tab-OBJectID.
      pointer = l_zconn_tab-pointer.
      PERFORM FIND_PARENT using   objectID
                                  pointer
                        changing  l_zconn_tab1.
endloop.
ENDFUNCTION.
FORM FIND_PARENT using     u_objectID like objectID
                           u_pointer  like  pointer
                 changing  c_zconn_tab like l_zconn_tab1.
     LOOP AT result_struc.
      if result_struc-pup = u_pointer.
      z_struc-objectID = u_objectID.
      z_struc-parentID = result_struc-objid.
      endif.
      Append z_struc to l_zconn_tab.
    ENDLOOP.
ENDFORM.

I guess I might be missing something, all you need to do is read the table with a key into a different work area, then move the values in to your structure and append to new table.
FUNCTION Z_ORGBUILDER_CONN.
*"*"Local interface:
*" IMPORTING
*" VALUE(OTYPE) LIKE OBJEC-OTYPE
*" VALUE(OBJID) LIKE OBJEC-OBJID
*" VALUE(PATHID) LIKE GDSTR-WEGID
*" VALUE(PLVAR) LIKE OBJEC-PLVAR
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
*" TABLES
*" L_ZCONN_TAB TYPE ZCONN_TAB
*" RESULT_TAB STRUCTURE SWHACTOR OPTIONAL
*" RESULT_OBJEC STRUCTURE OBJEC OPTIONAL
*" RESULT_STRUC STRUCTURE STRUC OPTIONAL
*" L_ZCONN_TAB1 TYPE ZCONN_TAB
DATA: z_struc type zconn_struc.
DATA: OBJectID type struc-objid.
DATA: pointer type struc-pup.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = otype
act_objid = objid
act_plvar = plvar
act_wegid = pathid
TABLES
result_tab = result_tab
result_struc = result_struc
result_objec = result_objec
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
RAISE no_roots_found.
ENDIF.
<b>LOOP AT result_struc into xresult_struc.
read table result_struc into yresult_struc
         with key pup = xresult_struc-pup.
if sy-subrc = 0.
z_struc-objectID = xresult_struc-OBJID.
z_struc-parentID = yresult_struc-objid.
endif.
Append z_struc to l_zconn_tab.
ENDLOOP.</b>
ENDFUNCTION.
Regards,
Rich Heilman

Similar Messages

  • Tracing Form and Function modules using SE30

    Hi,
      I want to trace only the Forms and function modules that are executed by a program using SE30. I have tried setting the variants in different ways but it still gives lot of junk information which i dont need. How can I set up the variant so that it only traces Forms and function modules executed by a program?
    Will give points to right answer. Thanks for reading

    Hi Srikrishna,
    First of all create a vraian tin SE30. While creating the variant, in th Tab 'Duratn/Type' select the radio buton 'NONE'. Now execute yur program and then analyse.Select 'GROUP HIT LIST' Icon which gives Function Modules,Subroutines etc.
    Regards,
    Srinivas.

  • Form and Function Module

    Is there a way to put a form endform block into the definition of a function module?
    tnx
    Gabriele

    Hi Gabriele,
    I dont think so. I have seen  people adding the FORM.... ENDFORM after ENDFUNCTION statement.
    But within the FUNCTION.......... ENDFUNCTION i dont think it is possible.
    Regards,
    Prakash Pandey

  • How to create purchase order report  form MM function module

    Dear All,
                  i need customized purchase order report with logo and grand total.
    regards,
    krishna

    hi,
    When you are using the outline agreement for the PR and then shd use for the PO...from where this RFQ comes in the scene??
    Also PR is already asigned to the source as outline agreement...
    Regards
    Priyanka.P
    Edited by: Priyanka Paltanwale on Nov 7, 2008 6:03 AM

  • Issue with the Package/request while creating service from function module

    Hi
    I'm creating a service form a function module. After the web service creator starts, There is a last step that asks for package and transport request. If i choose local objects, showing error as "Test Objects cannot be created in foriegn namespaces. If i give the package as it is in the attributes of the function module and transport request, showing error as " No tasks exists under the request. What is transport request??
    please if anyone has recently done such a process with NetWeaver PI 7.1. help me..
    Thanks
    Vijay

    You have to create a package for your objectsin SE80 transaction.
    How?
    http://www.sap-img.com/basis/steps-for-creating-package.htm
    Then assign this package name in your webservice creation.
    When asked for a transaport request, create one(You will find a create transport request inthe pop up which prompts you for creation of transport request).
    Regards,
    ravi kanth talagana

  • How to organize function modules & subroutines in a function group?

    Hi,
    There are several function modules and subroutines in a function group. And the subroutines will be called by severel modules.
    Originally:
    1. I put subroutine forms in an Include.
    2. and in the function modules which will use the forms, I include the Include before the function definition.
    3. While when activating the functin modules, it's reported that the forms had already been defined. Only if one function module includes the Include, it's OK.
    How should the forms and function modules be organized?
    Thanks!
    Sayid

    Hi Atish
    Yes, you are right.
    It works.
    Thank you.
    Regards,
    Sayid

  • Functional Module or BAPI for changing Material Type

    Hi,
    There is a Transaction MMAM for changing the Material Type in SAP. Can anyone help me in figuring out a Functional Module which can change the Material Type like how MMAM transaction does. Is anyone aware of any FM or BAPI that can take import parameters as Material Number and New Material Type and change the material type to the New one.
    I tried using the BDC but got some performance issues with it.
    Thanks
    Vinay

    Could you please put some light on which part of the transaction MMAM is responsible in changing the Material type. I can understand that there may exist may checks in the Tx MMAM but I would like to know  where is the material Type getting changed in the Tx MMAM. On going through the Tx MMAM I have across many forms and function modules but its difficult to track the form/Function Module responsible for changing the Material Type. Please help me in this.

  • Using subroutines in Function Module

    Hi , experts ,
    I want to know how to use performs in function module,
    If created subroutine must be used in all FM in  Func.Group ?
    if you have  articles about this or any information , I will be glad .
    Please help.
    Regards,
    Tatiana.

    If i am not mistaken you want to use forms in function module.
    To enable forms in function module you have to follow these steps:
    Create a Z include in your function module.
    INCLUDE ZTEST_INCLUDE.
    Inside this include you need to write your form routine which will be accessable from your function module.
    Now you can use perform statement in your funtion module.
    Thnaks & Regards,
    Lalit Mohan Gupta

  • BTE Name in Called Function Module

    Hello,
    A function module say XYZ is called from a BTE. Can I know the name of the BTE which called the function module XYZ inside the function module XYZ ?
    With Regards,
    Avisesh.

    I think this document may help you...
    <b>Business Transaction Events</b>
    This activity describes how you can connect additional components (such as in the form of function modules developed yourself or a product from an external software provider) to the standard R/3 System.
    There are two types of interface available in the General Ledger
    Accounting (FI-GL), Accounts Receivable and Accounts Payable
    (FI-AR/FI-AP), and Sales and Distribution (SD) components for this:
    1. Publish & Subscribe interfaces (also called "informing interfaces" in the following) These should inform you about particular events (such as a document being entered) in the SAP standard application and make the data generated as a result available to the external software. The external software does not return any data to the standard R/3 System.
    (I'm confused. MIT is using two business transaction events for the SD to FI interface. Both of these events are Publish & Subscribe interfaces. They both return data to the SAP standard application! They both change the FI document before it is posted. What I've figured out is that if there is an export to memory and an import from memory before and after the function call, then we can't modify the data. We can check this in the calling function module - OUTBOUND_CALL_00503110_E or OPEN_FI_PERFORM_00001020_E, etc)
    Examples of such events in the R/3 System are:
    Master record was created, changed, or blocked
    Document was entered, parked, changed, or reversed
    Items were cleared or reset
    Additional processing can be caused in the additional component on the basis of these events and data:
    Starting a workflow
    Generating or changing additional data
    Requesting correspondence
    FI Clearing (F-32) calls (gathered via SE30):
    Function OPEN_FI_PERFORM_00001020_E (can't modify data)
    00001020 POST DOCUMENT:       Prior to final checks
    EVENT
    This Event is reached prior to completing the document. The checks that are carried out at this point include checking, prior to posting, that the document balances to zero, and calculations for tax offsetting. This Event is accessed once per standard posting process and is similar to validation at document level (Event 0003). A document number has not yet
    been assigned when this Event is reached.
    INTERFACE
    All document line items created and the document header data are
    transferred (both as tables).
    Parameter
    T_BSEG
    T_BKPF
    Function OPEN_FI_PERFORM_00001025_E (can't modify data)
    00001025 POST DOCUMENT:       Final checks completed
    EVENT
    This Event lies following all checks on the whole document, but prior to number assignment. Following this Event, no further error messages may be sent. The document is complete at this point, and no further changes can be made to it prior to posting.
    INTERFACE
    All current data, all document data relevant for the posting, and various control parameters are transferred to the additional component. At this point you can still implement your own checks on the current document data.
    Parameter
    I_BKDF
    T_AUSZ1
    T_AUSZ2
    T_AUSZ3
    T_BKP1
    T_BKPF
    T_BSEC
    T_BSED
    T_BSEG
    T_BSET
    T_BSEU
    Function OPEN_FI_PERFORM_00001030_E (can't modify data)
    Function OPEN_FI_PERFORM_00001140_E (can't modify data)
    2. Process interfaces (also referred to as "process" in the following) Process interfaces are used to submit business processes to a different control which cannot be realized with the standard system, that is process interfaces replace standard processes. Here you can structure determination of individual field contents or of specific reactions to process flows individually. It is possible to connect different external developments to the standard R/3 System. The additional developments are generally carried out using the ABAP/4 Development Workbench. This way you can, for example, influence the control of payment transactions. Selection of payment method, house bank and partner bank can be made using the payment data (currency, amount, and payee) according to a selection logic which you have defined.
    FI Clearing (F-32) calls:
    Function OPEN_FI_PERFORM_00001120_P
    Function OPEN_FI_PERFORM_00001130_P
    Function OPEN_FI_PERFORM_00001150_P
    Function OPEN_FI_PERFORM_00001170_P
    Standard Settings
    Sample modules are delivered in the standard R/3 System which you can
    copy into your name range and fill them with statements there.
    Activities
    1. Enter a product using "Settings -> Customer's products". Actually, in 4.6C, from transaction FIBF (IMG -> Financial Accounting -> Financial Accounting Global
    Settings -> Business Transaction Events):
    Settings -> Products -> ...of a customer
    There are generally a large number of function modules belonging to a product which can be called by different program events from within the standard R/3 System. A product can also be an external software component. If the product is in an external system, enter an RFC destination here. If the product is in the same system, you do not have to enter anything. Important: Do not forget to activate the product after making the following settings.
    2. Establish the interfaces with which the R/3 System provides you. To do this, choose
    Environment -> Info system (P/S)
    or
    Environment -> Info system (Processes).
    Execute the program. You should enter "A" as the
    attribute type. You see the respective interfaces with which the R/3 System provides you. Note the key of the interface which you require.
    You can also select:
    By particular SAP application components
    By particular events by entering intervals
    Which interfaces are used in activated products
    Which interfaces are used within a particular country version or within a particular industry
    Which interfaces are used within a particular customer product
    3. Enter the function module which you have developed yourself. To do this, choose either Goto -> Edit modules within the info system or Settings -> P/S modules or Process modules -> Customer's in the "SAP Business Framework" menu. Make the following entries:
    Key for the interface
    The product that you want to use
    Function module which belongs to this product.
    You can also enter several function modules for a product. Caution:
    The function module must be within your name range, that is must begin with the letter Z. You leave the Ctr and Appl. fields blank unless you want a particular country version or a particular SAP industry-specific component to be enhanced or replaced instead of the standard process flow.
    4. Fill the source text of your function module
    and activate it. To do this, go again via Environment -> Info system (P/S) or Environment -> Info system (Processes) into the information system and execute the program. Then proceed as follows:
    Click twice on the interface you have chosen. If you want, you can look at the interface at this point by choosing Goto -> Interface. Then choose the Back function again afterwards.
    Place the cursor on the relevant line and choose Goto -> Function library. You see the sample function module delivered by SAP.
    Copy the sample module delivered by SAP and call it the same as the function module entered in step 3.
    Fill the source text of the empty function module.
    Activate the function module.
    Activate the product as described in step 1.
    5. Run the R/3 program affected and test whether calling your function module works.
    Further Notes
    The other menu paths are only used for information about additional components delivered by SAP or about software already installed by external software providers.

  • Is it possible to call a adobe form inside a function module?

    Hi gurus,
    i am trying to generate the pdf data source inside a custom function module,
    the function module will call the FUNCTION 'FP_JOB_OPEN' , then call the function module of the pdf interface. then get the pdf data back and return.
    but at run time i got the error message:
    FPRUNX101, the job already started.
    then the program stopped.
    i checked the service market place, there is a note for that:858325 Message "Job already started" when you display PDF forms .
    according to the notes,it seems that it's only possible to call the pdf generated function module in a program.
    my question is , is there a way to call that in a funciton module?
    best regards.
    Jun
    the note states that:
    Reason and Prerequisites
    At runtime, a PDF-based form is called using a generated function module. If you use the new interface, it is necessary to set the function modules FP_JOB_OPEN and FP_JOB_CLOSE as control structures with one or several generated function modules. In order for the single test from Transaction SFP to work simultaneously, however, the system checks for the test environment of Transaction SE37 (in which the test ultimately runs) in the single test. In this case, the function modules FP_JOB_OPEN or FP_JOB_CLOSE are called automatically.
    If you then test a function module that calls a PDF based form and therefore calls the function module FP_JOB_OPEN itself, this leads to the error message mentioned above.
    Solution
    The test should be carried out using a program that in turn calls the function module to be tested.

    sorry, i found out the reason.
    the fm can not test direct in se37, it should be wrapped by a program.
    br.
    zj

  • Error "Job already started" when calling a adobe form in Z function module

    Hi All,
    I have a error when calling a adobe form in a custom function module.
    I am using FP_FUNCTION_MODULE_NAME to get the adobe form function module and then i am using FP_JOB_OPEN function module to control the printing parameters such as no print preview or no dialog ..etc.. I dont have any exceptions during the call of FP_JOB_OPEN function module ..
    Later I am calling my function module which was generated for the adobe form and i am getting the error called " JOB ALREADY STARTED".
    I tried executing the same function module in se37 and the PDF form output was generated, and also by commenting FP_JOB_OPEN function module the PDF form output was generated.
    But i need the FP_JOB_OPEN function module to control the output based on the output type which triggers the form output such as the medium from nast record which says print or email or fax.. etc
    Please let me know how to handling this error.

    Just as a followup note. If you are testing a function module from SE37 and the test button you will get a value in SY-CPROG. You must override this value for everything to work.
    If you override the value of SY-CPROG with the main program that will be calling the function module you have no problem.
    John W.

  • Adobe Forms function module - downloading the xstring output in PDF file

    Hi Guys,
    I'm using Adobe forms and fetching its output in an XSTRING PDF format. How can I download this XSTRING output to a PDF file and store on the local file system?
    I'm using the following approach to getting a PDF output:
    ls_outputparams-getpdf = 'X'.
    CALL FUNCTION 'FP_JOB_OPEN'
      CHANGING
        ie_outputparams = ls_outputparams.
    * Get the name of the generated function module
      CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
        EXPORTING
          i_name     = 'ZADOBEFORM'
        IMPORTING
          e_funcname = lv_fmname.
      IF sy-subrc <> 0.
      ELSE.
    *   Call the Adobe Form function module
        CALL FUNCTION lv_fmname
          EXPORTING
            /1bcdwb/docparams  = ls_docparams
          IMPORTING
            /1bcdwb/formoutput = ls_form_output
          EXCEPTIONS
            usage_error        = 1
            system_error       = 2
            internal_error     = 3.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    * Close the spool job
    CALL FUNCTION 'FP_JOB_CLOSE'.
    Now, the variable LS_FORM_OUTPUT-PDF contains the PDF output in XSTRING. My question is how can I download this as a PDF file to my local machine.
    Kind Regards,
    Shailesh.

    hi guys,
    im using all FM to download my PDF adobe but in this part :
    ls_spfli-carrid = 'AA'.
    ls_spfli-connid = '0017'.
    APPEND ls_spfli TO it_spfli.
    flag                     = 'X'.
    is_address_type          = '1'.
    is_address_number        = '22515'.
    is_person_number         = '22517'.
    is_country               = 'IN'.
    *&--- Call the generated function module
    CALL FUNCTION '/1BCDWB/SM00000200'
       EXPORTING
    *   /1BCDWB/DOCPARAMS        =
         it_spfli                 = it_spfli
         flag                     = flag
         is_address_type          = is_address_type
         is_address_number        = is_address_number
         is_person_number         = is_person_number
         is_country               = is_country
      IMPORTING
        /1bcdwb/formoutput       = fp_formoutput
      EXCEPTIONS
        usage_error              = 1
        system_error             = 2
        internal_error           = 3
        OTHERS                   = 4
    I have usage_error knowing that the execution of the function module in SE37 pass successfuly and also the execution of the forms .
    in your opinion what can be the problem?
    Kind Regards,

  • Function module of smart form delivered an error

    Hi All,
    I am getting an error like this
    "Function module /1BCDWB/SF00000007 of smart form delivered an error"
    FUNCTION /1BCDWB/SF00000007.
    ""Global interface:
    *"       IMPORTING
    *"             VALUE(ARCHIVE_INDEX) TYPE  TOA_DARA OPTIONAL
    *"             VALUE(ARCHIVE_PARAMETERS) TYPE  ARC_PARAMS OPTIONAL
    *"             VALUE(CONTROL_PARAMETERS) TYPE  SSFCTRLOP OPTIONAL
    *"             VALUE(MAIL_APPL_OBJ) TYPE  SWOTOBJID OPTIONAL
    *"             VALUE(MAIL_RECIPIENT) TYPE  SWOTOBJID OPTIONAL
    *"             VALUE(MAIL_SENDER) TYPE  SWOTOBJID OPTIONAL
    *"             VALUE(OUTPUT_OPTIONS) TYPE  SSFCOMPOP OPTIONAL
    *"             VALUE(USER_SETTINGS) TYPE  TDBOOL DEFAULT 'X'
    *"             VALUE(ARCHIVE_INDEX_TAB) TYPE  TSFDARA OPTIONAL
    *"             REFERENCE(ORDERADM_H) TYPE  CRMT_OUTPUT_ORDERADM_H_COM
    *"             REFERENCE(ACTIVITY_H) TYPE  CRMT_OUTPUT_ACTIVITY_H_COM
    *"             REFERENCE(OPPORT_H) TYPE  CRMT_OUTPUT_OPPORT_H_COM
    *"             REFERENCE(ORGMAN_H) TYPE  CRMT_OUTPUT_ORGMAN_H_COM
    *"             REFERENCE(PARTNER_H) TYPE  CRMT_OUTPUT_PARTNER_H_COMT
    *"             REFERENCE(PRICINGDATA_H) TYPE
    *"                             CRMT_OUTPUT_PRICINGDATA_H_COM
    *"             REFERENCE(SALES_H) TYPE  CRMT_OUTPUT_SALES_H_COM
    *"             REFERENCE(SHIPPING_H) TYPE  CRMT_OUTPUT_SHIPPING_H_COM
    *"             REFERENCE(PAYPLAN_D_H) TYPE
    *"                             CRMT_OUTPUT_PAYPLAN_D_H_COMT
    *"             REFERENCE(CUMULAT_H) TYPE  CRMT_OUTPUT_CUMULAT_H_COM
    *"             REFERENCE(CUSTOMER_H) TYPE  CRMT_OUTPUT_CUSTOMER_H_COM
    *"             REFERENCE(ACS_H) TYPE  CRMT_ACS_H_COM
    *"             REFERENCE(BILLING_H) TYPE  CRMT_OUTPUT_BILLING_H_COMT
    *"             REFERENCE(CANCEL_H) TYPE  CRMT_OUTPUT_CANCEL_H_COMT
    *"             REFERENCE(APPOINTMENT_H) TYPE
    *"                             CRMT_OUTPUT_APPOINTMENT_H_COMT
    *"             REFERENCE(BILLPLAN_D_H) TYPE
    *"                             CRMT_OUTPUT_BILLPLAN_D_H_COMT
    *"             REFERENCE(BILLPLAN_H) TYPE  CRMT_OUTPUT_BILLPLAN_H_COMT
    *"             REFERENCE(STATUS_D_H) TYPE  CRMT_OUTPUT_STATUS_D_H_COMT
    *"             REFERENCE(STATUS_H) TYPE  CRMT_OUTPUT_STATUS_H_COMT
    *"             REFERENCE(SRV_SUBJECT_H) TYPE
    *"                             CRMT_OUTPUT_SRV_SUBJECT_H_COMT
    *"             REFERENCE(SRV_SUBJECT_I) TYPE
    *"                             CRMT_OUTPUT_SRV_SUBJECT_H_COMT
    *"             REFERENCE(SRV_REASON_H) TYPE
    *"                             CRMT_OUTPUT_SRV_REASON_H_COMT
    *"             REFERENCE(SRV_RESULT_H) TYPE
    *"                             CRMT_OUTPUT_SRV_RESULT_H_COMT
    *"             REFERENCE(SRV_REFOBJ_H) TYPE
    *"                             CRMT_OUTPUT_SRV_REFOBJ_H_COMT
    *"             REFERENCE(SRV_REFOBJ_I) TYPE
    *"                             CRMT_OUTPUT_SRV_REFOBJ_H_COMT
    *"             REFERENCE(ORDERADM_I) TYPE  CRMT_OUTPUT_ORDERADM_I_COMT
    *"             REFERENCE(ORDERADM_I_IN) TYPE
    *"                             CRMT_OUTPUT_ORDERADM_I_IN_COMT
    *"             REFERENCE(ORDERADM_I_QT) TYPE
    *"                             CRMT_OUTPUT_ORDERADM_I_QT_COMT
    *"             REFERENCE(ORGMAN_I) TYPE  CRMT_OUTPUT_ORGMAN_I_COMT
    *"             REFERENCE(PRICINGDATA_I) TYPE
    *"                             CRMT_OUTPUT_PRICINGDATA_I_COMT
    *"             REFERENCE(PRICING_I) TYPE  CRMT_OUTPUT_PRICING_I_COMT
    *"             REFERENCE(PRODUCT_I) TYPE  CRMT_OUTPUT_PRODUCT_I_COMT
    *"             REFERENCE(SALES_I) TYPE  CRMT_OUTPUT_SALES_I_COMT
    *"             REFERENCE(SERVICE_I) TYPE  CRMT_OUTPUT_SERVICE_I_COMT
    *"             REFERENCE(SCHEDLIN_I) TYPE  CRMT_OUTPUT_SCHEDLIN_I_COMT
    *"             REFERENCE(SCHEDLIN_I_CF) TYPE
    *"                             CRMT_OUTPUT_SCHEDLIN_I_CF_COMT
    *"             REFERENCE(SHIPPING_I) TYPE  CRMT_OUTPUT_SHIPPING_I_COMT
    *"             REFERENCE(PARTNER_I) TYPE  CRMT_OUTPUT_PARTNER_I_COMT
    *"             REFERENCE(ITEM_CSTICS_I) TYPE  CRMT_ITEM_CSTICS_TAB
    *"             REFERENCE(CUSTOMER_I) TYPE  CRMT_OUTPUT_CUSTOMER_I_COMT
    *"             REFERENCE(BILLING_I) TYPE  CRMT_OUTPUT_BILLING_I_COMT
    *"             REFERENCE(CANCEL_I) TYPE  CRMT_OUTPUT_CANCEL_I_COMT
    *"             REFERENCE(FINPROD_I) TYPE  CRMT_OUTPUT_FINPROD_I_COMT
    *"             REFERENCE(ORDPRP_I) TYPE  CRMT_OUTPUT_ORDPRP_I_COMT
    *"             REFERENCE(APPOINTMENT_I) TYPE
    *"                             CRMT_OUTPUT_APPOINTMENT_I_COMT
    *"             REFERENCE(BILLPLAN_D_I) TYPE
    *"                             CRMT_OUTPUT_BILLPLAN_D_I_COMT
    *"             REFERENCE(BILLPLAN_I) TYPE  CRMT_OUTPUT_BILLPLAN_I_COMT
    *"             REFERENCE(STATUS_I) TYPE  CRMT_OUTPUT_STATUS_I_COMT
    *"             REFERENCE(WORKING_SET_E_S_BBP) TYPE
    *"                             /1CN/WORKING_SET_E_S_BBP_T
    *"             REFERENCE(LANGUAGE) TYPE  SY-LANGU
    *"             REFERENCE(SERVICE_I_ASSI) TYPE
    *"                             CRMT_OUTPUT_SERVICE_I_***_COMT
    *"             VALUE(FORM_TYPE) TYPE  C OPTIONAL
    *"             REFERENCE(Y_V_PARTNER_FLAG) TYPE  C OPTIONAL
    *"       EXPORTING
    *"             VALUE(DOCUMENT_OUTPUT_INFO) TYPE  SSFCRESPD
    *"             VALUE(JOB_OUTPUT_INFO) TYPE  SSFCRESCL
    *"             VALUE(JOB_OUTPUT_OPTIONS) TYPE  SSFCRESOP
    *"       EXCEPTIONS
    *"              FORMATTING_ERROR
    *"              INTERNAL_ERROR
    *"              SEND_ERROR
    *"              USER_CANCELED
    DATA: %INPUT     TYPE SSFCOMPIN,
          %RESULT_OP TYPE SSFCRESOP,
          %RESULT_PD TYPE SSFCRESPD,
          %RESULT_CL TYPE SSFCRESCL,
          %TABDEF    LIKE LINE OF %TABDEFS,
          %ARCTAB    TYPE TSFDARA,
          BEGIN OF %FULLNAME,
            FORM TYPE TDSFNAME VALUE 'YCRM_ORDER_SERVICE_RMA',
            VARI TYPE TDVARIANT,
            ACTV TYPE TDBOOL VALUE 'X',
          END OF %FULLNAME.
    TYPES: T_XDF_ELEM(255)    TYPE C,
           T_XDF_ATTR(255)    TYPE C.
    DATA:  IMPORT_PARAMETER   TYPE TABLE OF RSIMP WITH HEADER LINE,
           CHANGING_PARAMETER TYPE TABLE OF RSCHA WITH HEADER LINE,
           TABLES_PARAMETER   TYPE TABLE OF RSTBL WITH HEADER LINE,
           EXPORT_PARAMETER   TYPE TABLE OF RSEXP WITH HEADER LINE,
           EXCEPTION_LIST     TYPE TABLE OF RSEXC WITH HEADER LINE.
    DATA:  XDF_TABLE          TYPE TSFIXML,
           XDF_LENGTH         TYPE I.
    DATA:  XDF_DOCUMENT       TYPE REF TO IF_IXML_DOCUMENT,
           XDF_PARAMETER      TYPE REF TO IF_IXML_ELEMENT,
           L_NAME             TYPE STRING,
           L_VALUE            TYPE STRING,
           L_OBJECT           TYPE STRING,
           L_DATE             TYPE STRING,
           L_TIME             TYPE STRING,
           RC                 TYPE SY-SUBRC.
    FIELD-SYMBOLS: <DATA_OBJECT> TYPE ANY.
    CLASS CL_IXML DEFINITION LOAD.
    CONSTANTS: C_XDF_ROOT_ELEMENT TYPE T_XDF_ELEM VALUE 'XDF',
           C_XDF_ATTR_TYPE       TYPE T_XDF_ATTR VALUE 'TYPE',
           C_XDF_ATTR_TIMESTAMP  TYPE T_XDF_ATTR VALUE 'TIMESTAMP',
           C_XDF_ATTR_OBJ        TYPE T_XDF_ATTR VALUE 'OBJECT'.
    DATA:  XDF_FACTORY      TYPE REF TO IF_IXML,
           XDF_ROOT_ELEMENT TYPE REF TO IF_IXML_ELEMENT.
    DATA:  L_GETSTATE    TYPE DDTYPEGET,
           L_TYPE        TYPE DDTYPEKIND,
           L_TYPE_NAME   TYPE TYPENAME,
           L_DDIC_OBJ    TYPE DDTYPES OCCURS 0 WITH HEADER LINE,
           L_DD02L_STATE TYPE DD02L   OCCURS 0 WITH HEADER LINE,
           L_DD04L_STATE TYPE DD04L   OCCURS 0 WITH HEADER LINE,
           L_DD40L_STATE TYPE DD40L   OCCURS 0 WITH HEADER LINE,
           L_XMLOUTPUT   TYPE SSFXMLOUT,
           L_SFSY        TYPE SFSY.
    TYPE-POOLS: ABAP.
    DATA: XDF2_IXML        TYPE REF TO IF_IXML,
          XDF2_DOCUMENT    TYPE REF TO IF_IXML_DOCUMENT,
          XDF2_SRC_OBJECTS TYPE ABAP_TRANS_SRCBIND_TAB,
          XDF2_SRC_OBJECT  LIKE LINE OF XDF2_SRC_OBJECTS.
    DEFINE XDF2_APPEND_SRC_OBJECT.
      XDF2_SRC_OBJECT-NAME  = '&1'.
      TRANSLATE XDF2_SRC_OBJECT-NAME TO UPPER CASE.
      GET REFERENCE OF &2 INTO XDF2_SRC_OBJECT-VALUE.
      APPEND XDF2_SRC_OBJECT TO XDF2_SRC_OBJECTS.
    END-OF-DEFINITION.
    DEFINE XDF_GET_DDIC_INFO.
      CLEAR L_DDIC_OBJ.
      IF NOT &2 IS INITIAL.
        L_TYPE_NAME = &2.
      ELSEIF NOT &1-TYP IS INITIAL.
        L_TYPE_NAME = &1-TYP.
      ELSEIF NOT &1-LINE_OF IS INITIAL.
        L_TYPE_NAME = &1-LINE_OF.
      ELSEIF NOT &1-TABLE_OF IS INITIAL.
        L_TYPE_NAME = &1-TABLE_OF.
      ELSE.
        CLEAR L_TYPE_NAME.
      ENDIF.
      CALL FUNCTION 'DDIF_TYPEINFO_GET'
           EXPORTING TYPENAME = L_TYPE_NAME
           IMPORTING TYPEKIND = L_TYPE.
      L_DDIC_OBJ-TYPENAME = L_TYPE_NAME.
      L_DDIC_OBJ-TYPEKIND = L_TYPE.
      IF NOT L_DDIC_OBJ IS INITIAL.
        COLLECT L_DDIC_OBJ.
      ENDIF.
    END-OF-DEFINITION.
    DEFINE XDF_CREATE_DATA_STREAM.
      CLEAR: L_OBJECT, L_DATE, L_TIME, L_NAME, L_TYPE_NAME, L_VALUE.
      IF &3 = 'T'.
        CONCATENATE &1-PARAMETER '[]' INTO L_NAME.
      ELSE.
        L_NAME = &1-PARAMETER.
      ENDIF.
      IF NOT &2 IS INITIAL.
        ASSIGN (L_NAME) TO <DATA_OBJECT>
               CASTING TYPE (&2).
        L_TYPE_NAME = &2.
      ELSEIF NOT &1-TYP IS INITIAL.
        ASSIGN (L_NAME) TO <DATA_OBJECT>
               CASTING TYPE (&1-TYP).
        L_TYPE_NAME = &1-TYP.
      ELSEIF NOT &1-LINE_OF IS INITIAL.
        ASSIGN (L_NAME) TO <DATA_OBJECT>.
        L_TYPE_NAME = &1-LINE_OF.
      ELSEIF NOT &1-TABLE_OF IS INITIAL.
        ASSIGN (L_NAME) TO <DATA_OBJECT>.
        L_TYPE_NAME = &1-TABLE_OF.
      ELSE.
        ASSIGN (L_NAME) TO <DATA_OBJECT>.
        CLEAR L_TYPE_NAME.
      ENDIF.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
           EXPORTING
                 NAME        = L_NAME
                 DATAOBJECT  = <DATA_OBJECT>
           IMPORTING
                 DATA_AS_DOM = XDF_PARAMETER
           CHANGING
                  DOCUMENT    = XDF_DOCUMENT
             EXCEPTIONS
                  OTHERS      = 1.
      L_NAME  = C_XDF_ATTR_TYPE.
      L_VALUE = L_TYPE_NAME.
      CALL METHOD XDF_PARAMETER->SET_ATTRIBUTE
           EXPORTING NAME      = L_NAME
                        VALUE     = L_VALUE
           RECEIVING RVAL      = RC.
      CLEAR L_DDIC_OBJ.
      READ TABLE L_DDIC_OBJ WITH KEY TYPENAME = L_TYPE_NAME.
      CASE L_DDIC_OBJ-TYPEKIND.
        WHEN 'S'.
          READ TABLE L_DD02L_STATE WITH KEY TABNAME = &1-TYP.
          L_DATE = L_DD02L_STATE-AS4DATE.
          L_TIME = L_DD02L_STATE-AS4TIME.
          L_OBJECT = 'TABL'.
        WHEN 'E'.        " data elements
          READ TABLE L_DD04L_STATE WITH KEY ROLLNAME = &1-TYP.
          L_DATE = L_DD04L_STATE-AS4DATE.
          L_TIME = L_DD04L_STATE-AS4TIME.
          L_OBJECT = 'DTEL'.
        WHEN 'L'.        " table types
          READ TABLE L_DD40L_STATE WITH KEY TYPENAME = &1-TYP.
          L_DATE = L_DD40L_STATE-AS4DATE.
          L_TIME = L_DD40L_STATE-AS4TIME.
          L_OBJECT = 'TTYP'.
        WHEN OTHERS.
          CLEAR: L_DATE, L_TIME, L_OBJECT.
      ENDCASE.
      L_NAME  = C_XDF_ATTR_OBJ.
      CALL METHOD XDF_PARAMETER->SET_ATTRIBUTE
           EXPORTING NAME      = L_NAME
                     VALUE     = L_OBJECT
           RECEIVING RVAL      = RC.
      L_NAME  = C_XDF_ATTR_TIMESTAMP.
      CONCATENATE L_DATE L_TIME INTO L_VALUE.
      CALL METHOD XDF_PARAMETER->SET_ATTRIBUTE
           EXPORTING NAME      = L_NAME
                     VALUE     = L_VALUE
           RECEIVING RVAL      = RC.
      CALL METHOD XDF_ROOT_ELEMENT->APPEND_CHILD
           EXPORTING NEW_CHILD = XDF_PARAMETER
           RECEIVING RVAL      = RC.
      CHECK RC = 0.
    END-OF-DEFINITION.
    CLEAR DOCUMENT_OUTPUT_INFO.
    CLEAR JOB_OUTPUT_INFO.
    CLEAR JOB_OUTPUT_OPTIONS.
    L_SFSY = SFSY.
    CLEAR SFSY.
    SFSY-PAGE = L_SFSY-PAGE.
    SFSY-FORMPAGES = L_SFSY-FORMPAGES.
    SFSY-JOBPAGES = L_SFSY-JOBPAGES.
    SFSY-XDF = L_SFSY-XDF.
    SFSY-XDF2 = L_SFSY-XDF2.
    CLEAR INTSFSY.
    IF CONTROL_PARAMETERS-NO_OPEN = SPACE.
       CALL FUNCTION 'SSF_CREATE_COMPOSER_INPUT'
            EXPORTING
                 ARCHIVE_PARAMETERS = ARCHIVE_PARAMETERS
                 USER_SETTINGS      = USER_SETTINGS
                 MAIL_SENDER        = MAIL_SENDER
                 MAIL_RECIPIENT     = MAIL_RECIPIENT
                 MAIL_APPL_OBJ      = MAIL_APPL_OBJ
                 OUTPUT_OPTIONS     = OUTPUT_OPTIONS
                 CONTROL_PARAMETERS = CONTROL_PARAMETERS
            IMPORTING
                 INPUT              = %INPUT.
      IF OUTPUT_OPTIONS-XSFCMODE = SPACE.
        %INPUT-XSF        = ' '.
        %INPUT-XSFOUTMODE = ' '.
        %INPUT-XSFOUTDEV  = ' '.
        %INPUT-XSFACTION  = ' '.
        %INPUT-XSFFORMAT  = ' '.
      ENDIF.
      CALL FUNCTION 'SSFCOMP_OPEN'
           EXPORTING  INPUT  = %INPUT
           IMPORTING  RESULT = %RESULT_OP
           EXCEPTIONS OTHERS = 1.
      IF SY-SUBRC <> 0.
        %VARIANT = SPACE.
        PERFORM %RAISE.
      ENDIF.
      JOB_OUTPUT_OPTIONS = %RESULT_OP.
    ENDIF.
    IF SFSY-XDF = 'X'.
      CALL FUNCTION 'FUNCTION_IMPORT_INTERFACE'
           EXPORTING
                FUNCNAME           = '/1BCDWB/SF00000007'
                INACTIVE_VERSION   = SPACE
           TABLES
                IMPORT_PARAMETER   = IMPORT_PARAMETER
                CHANGING_PARAMETER = CHANGING_PARAMETER
                TABLES_PARAMETER   = TABLES_PARAMETER
                EXPORT_PARAMETER   = EXPORT_PARAMETER
                EXCEPTION_LIST     = EXCEPTION_LIST
           EXCEPTIONS
                OTHERS             = 1.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      L_GETSTATE-TBHD = L_GETSTATE-TBFD = L_GETSTATE-DTEL = 'X'.
      L_GETSTATE-TTHD = L_GETSTATE-TTFD = 'X'.
      LOOP AT IMPORT_PARAMETER.
        XDF_GET_DDIC_INFO IMPORT_PARAMETER IMPORT_PARAMETER-DBFIELD.
      ENDLOOP.
      LOOP AT CHANGING_PARAMETER.
        XDF_GET_DDIC_INFO CHANGING_PARAMETER
                          CHANGING_PARAMETER-DBFIELD.
      ENDLOOP.
      LOOP AT TABLES_PARAMETER.
        XDF_GET_DDIC_INFO TABLES_PARAMETER TABLES_PARAMETER-DBSTRUCT.
      ENDLOOP.
      CALL FUNCTION 'DD_TYPEINFO_GET'
           EXPORTING  GETSTATE    = L_GETSTATE
           TABLES     DDTYPES_TAB = L_DDIC_OBJ[]
                      DD02L_TAB   = L_DD02L_STATE[]
                      DD04L_TAB   = L_DD04L_STATE[]
                      DD40L_TAB   = L_DD40L_STATE[].
      XDF_FACTORY = CL_IXML=>CREATE( ).
      XDF_DOCUMENT = XDF_FACTORY->CREATE_DOCUMENT( ).
      L_NAME = C_XDF_ROOT_ELEMENT.
      XDF_ROOT_ELEMENT
           = XDF_DOCUMENT->CREATE_ELEMENT( NAME = L_NAME ).
      CALL METHOD XDF_DOCUMENT->APPEND_CHILD
           EXPORTING  NEW_CHILD  = XDF_ROOT_ELEMENT
           RECEIVING  RVAL       = RC.
      CHECK RC = 0.
      LOOP AT IMPORT_PARAMETER.
        XDF_CREATE_DATA_STREAM IMPORT_PARAMETER
                               IMPORT_PARAMETER-DBFIELD 'I'.
      ENDLOOP.
      LOOP AT CHANGING_PARAMETER.
        XDF_CREATE_DATA_STREAM CHANGING_PARAMETER
                               CHANGING_PARAMETER-DBFIELD 'C'.
      ENDLOOP.
      LOOP AT TABLES_PARAMETER.
        XDF_CREATE_DATA_STREAM TABLES_PARAMETER
                               TABLES_PARAMETER-DBSTRUCT 'T'.
      ENDLOOP.
      CALL FUNCTION 'SSFCOMP_XDF_OUTPUT'
           EXPORTING  DOCUMENT = XDF_DOCUMENT
           EXCEPTIONS OTHERS   = 1.
    ELSEIF SFSY-XDF2 = 'X'.
      XDF2_IXML     = CL_IXML=>CREATE( ).
      XDF2_DOCUMENT = XDF2_IXML->CREATE_DOCUMENT( ).
      XDF2_APPEND_SRC_OBJECT ARCHIVE_INDEX ARCHIVE_INDEX.
      XDF2_APPEND_SRC_OBJECT ARCHIVE_PARAMETERS ARCHIVE_PARAMETERS.
      XDF2_APPEND_SRC_OBJECT CONTROL_PARAMETERS CONTROL_PARAMETERS.
      XDF2_APPEND_SRC_OBJECT MAIL_APPL_OBJ MAIL_APPL_OBJ.
      XDF2_APPEND_SRC_OBJECT MAIL_RECIPIENT MAIL_RECIPIENT.
      XDF2_APPEND_SRC_OBJECT MAIL_SENDER MAIL_SENDER.
      XDF2_APPEND_SRC_OBJECT OUTPUT_OPTIONS OUTPUT_OPTIONS.
      XDF2_APPEND_SRC_OBJECT USER_SETTINGS USER_SETTINGS.
      XDF2_APPEND_SRC_OBJECT ARCHIVE_INDEX_TAB ARCHIVE_INDEX_TAB.
      XDF2_APPEND_SRC_OBJECT ORDERADM_H ORDERADM_H.
      XDF2_APPEND_SRC_OBJECT ACTIVITY_H ACTIVITY_H.
      XDF2_APPEND_SRC_OBJECT OPPORT_H OPPORT_H.
      XDF2_APPEND_SRC_OBJECT ORGMAN_H ORGMAN_H.
      XDF2_APPEND_SRC_OBJECT PARTNER_H PARTNER_H.
      XDF2_APPEND_SRC_OBJECT PRICINGDATA_H PRICINGDATA_H.
      XDF2_APPEND_SRC_OBJECT SALES_H SALES_H.
      XDF2_APPEND_SRC_OBJECT SHIPPING_H SHIPPING_H.
      XDF2_APPEND_SRC_OBJECT PAYPLAN_D_H PAYPLAN_D_H.
      XDF2_APPEND_SRC_OBJECT CUMULAT_H CUMULAT_H.
      XDF2_APPEND_SRC_OBJECT CUSTOMER_H CUSTOMER_H.
      XDF2_APPEND_SRC_OBJECT ACS_H ACS_H.
      XDF2_APPEND_SRC_OBJECT BILLING_H BILLING_H.
      XDF2_APPEND_SRC_OBJECT CANCEL_H CANCEL_H.
      XDF2_APPEND_SRC_OBJECT APPOINTMENT_H APPOINTMENT_H.
      XDF2_APPEND_SRC_OBJECT BILLPLAN_D_H BILLPLAN_D_H.
      XDF2_APPEND_SRC_OBJECT BILLPLAN_H BILLPLAN_H.
      XDF2_APPEND_SRC_OBJECT STATUS_D_H STATUS_D_H.
      XDF2_APPEND_SRC_OBJECT STATUS_H STATUS_H.
      XDF2_APPEND_SRC_OBJECT SRV_SUBJECT_H SRV_SUBJECT_H.
      XDF2_APPEND_SRC_OBJECT SRV_SUBJECT_I SRV_SUBJECT_I.
      XDF2_APPEND_SRC_OBJECT SRV_REASON_H SRV_REASON_H.
      XDF2_APPEND_SRC_OBJECT SRV_RESULT_H SRV_RESULT_H.
      XDF2_APPEND_SRC_OBJECT SRV_REFOBJ_H SRV_REFOBJ_H.
      XDF2_APPEND_SRC_OBJECT SRV_REFOBJ_I SRV_REFOBJ_I.
      XDF2_APPEND_SRC_OBJECT ORDERADM_I ORDERADM_I.
      XDF2_APPEND_SRC_OBJECT ORDERADM_I_IN ORDERADM_I_IN.
      XDF2_APPEND_SRC_OBJECT ORDERADM_I_QT ORDERADM_I_QT.
      XDF2_APPEND_SRC_OBJECT ORGMAN_I ORGMAN_I.
      XDF2_APPEND_SRC_OBJECT PRICINGDATA_I PRICINGDATA_I.
      XDF2_APPEND_SRC_OBJECT PRICING_I PRICING_I.
      XDF2_APPEND_SRC_OBJECT PRODUCT_I PRODUCT_I.
      XDF2_APPEND_SRC_OBJECT SALES_I SALES_I.
      XDF2_APPEND_SRC_OBJECT SERVICE_I SERVICE_I.
      XDF2_APPEND_SRC_OBJECT SCHEDLIN_I SCHEDLIN_I.
      XDF2_APPEND_SRC_OBJECT SCHEDLIN_I_CF SCHEDLIN_I_CF.
      XDF2_APPEND_SRC_OBJECT SHIPPING_I SHIPPING_I.
      XDF2_APPEND_SRC_OBJECT PARTNER_I PARTNER_I.
      XDF2_APPEND_SRC_OBJECT ITEM_CSTICS_I ITEM_CSTICS_I.
      XDF2_APPEND_SRC_OBJECT CUSTOMER_I CUSTOMER_I.
      XDF2_APPEND_SRC_OBJECT BILLING_I BILLING_I.
      XDF2_APPEND_SRC_OBJECT CANCEL_I CANCEL_I.
      XDF2_APPEND_SRC_OBJECT FINPROD_I FINPROD_I.
      XDF2_APPEND_SRC_OBJECT ORDPRP_I ORDPRP_I.
      XDF2_APPEND_SRC_OBJECT APPOINTMENT_I APPOINTMENT_I.
      XDF2_APPEND_SRC_OBJECT BILLPLAN_D_I BILLPLAN_D_I.
      XDF2_APPEND_SRC_OBJECT BILLPLAN_I BILLPLAN_I.
      XDF2_APPEND_SRC_OBJECT STATUS_I STATUS_I.
      XDF2_APPEND_SRC_OBJECT WORKING_SET_E_S_BBP WORKING_SET_E_S_BBP.
      XDF2_APPEND_SRC_OBJECT LANGUAGE LANGUAGE.
      XDF2_APPEND_SRC_OBJECT SERVICE_I_ASSI SERVICE_I_ASSI.
      XDF2_APPEND_SRC_OBJECT FORM_TYPE FORM_TYPE.
      XDF2_APPEND_SRC_OBJECT Y_V_PARTNER_FLAG Y_V_PARTNER_FLAG.
      XDF2_APPEND_SRC_OBJECT JOB_OUTPUT_INFO JOB_OUTPUT_INFO.
      CALL TRANSFORMATION ID
           SOURCE (XDF2_SRC_OBJECTS)
           RESULT XML XDF2_DOCUMENT.
      CALL FUNCTION 'SSFCOMP_XDF2_OUTPUT'
        EXPORTING
          DOCUMENT = XDF2_DOCUMENT
        EXCEPTIONS
          OTHERS   = 1.
      IF SY-SUBRC <> 0. RAISE ERROR. ENDIF.
    ELSE.
      %FULLNAME-VARI = %VARIANT.
      %VARIANT = SPACE.
      IF %HEADER IS INITIAL.
        IMPORT HEADER   TO %HEADER
               REFTAB   TO %REFTAB
               DOCSTRUC TO %DOCSTRUC
               TABDEF   TO %TABDEFS
               FROM DATABASE STXFCONTR(SF) ID %FULLNAME.
        IF SY-SUBRC <> 0.
          CALL FUNCTION 'SSFRT_SET_ERROR_PARAMETERS'
               EXPORTING I_FORM      = 'YCRM_ORDER_SERVICE_RMA'.
          CALL FUNCTION 'SSFRT_WRITE_ERROR'
               EXPORTING I_ERRNUMBER = SSF_ERR_NO_RUNTIME_OBJECT
                         I_MSGID     = 'SSFCOMPOSER'
                         I_MSGNO     = '002'
                         I_MSGV1     = 'YCRM_ORDER_SERVICE_RMA'.
          PERFORM %RAISE.
        ENDIF.
        SELECT SINGLE SDATE STIME FROM D010SINF
          INTO (%HEADER-SDATE, %HEADER-STIME)
          WHERE PROG    = '/1BCDWB/SAPLSF00000007'
            AND R3STATE = 'A'.
        IF SY-SUBRC <> 0.
          CLEAR: %HEADER-SDATE,
                 %HEADER-STIME.
        ENDIF.
      ENDIF.
      LOOP AT %TABDEFS INTO %TABDEF.
        CALL FUNCTION 'SSFCOMP_TABLE_DEFINITION'
             EXPORTING  CPI    = %HEADER-CPI
                        LPI    = %HEADER-LPI
             CHANGING   TABDEF = %TABDEF
             EXCEPTIONS OTHERS = 1.
        IF SY-SUBRC <> 0. PERFORM %RAISE. ENDIF.
      ENDLOOP.
      CALL FUNCTION 'SSFRT_SET_REFERENCES'
           EXPORTING I_REFTAB = %REFTAB .
      CALL FUNCTION 'SSFRT_SET_LANGUAGES'
           EXPORTING I_CONTROL_PARAMETERS = CONTROL_PARAMETERS
                     I_MASTERLANGUAGE     = 'E'
                     I_THRULANG           = ' '
                     I_INSTALL_LANG       = ' '
           IMPORTING O_LANGUAGES          = %LANGUAGES.
      %HEADER-LANGU = %LANGUAGES-LANGU1.
      %WEXIT = SPACE.
      PERFORM %GLOBAL_CLEAR.
      PERFORM %GLOBAL_INIT.
      CLEAR %ARCTAB.
      IF ARCHIVE_INDEX_TAB[] IS INITIAL.
        APPEND ARCHIVE_INDEX TO %ARCTAB.
      ELSE.
        %ARCTAB = ARCHIVE_INDEX_TAB.
      ENDIF.
    > CALL FUNCTION 'SSFCOMP_PROCESS_DOCUMENT'
           EXPORTING  HEADER           = %HEADER
                      DOCSTRUC         = %DOCSTRUC
                      STARTPAGE        = CONTROL_PARAMETERS-STARTPAGE
                      ARCHIV_INDEX_TAB = %ARCTAB
                      MAIL_APPL_OBJECT = MAIL_APPL_OBJ
           IMPORTING  RESULT           = %RESULT_PD
           EXCEPTIONS OTHERS           = 1.
      IF SY-SUBRC <> 0. PERFORM %RAISE. ENDIF.
      DOCUMENT_OUTPUT_INFO = %RESULT_PD.
    ENDIF.
    The function module 'SSFCOMP_PROCESS_DOCUMENT' is returning sy-subrc value 1.
    Could you please tell me how to rectify this error
    Thanks and Regards,
    Soumya.

    The error I am getting is a formatting error as shown below:
    L_ERROR-MSGTY                  E
    L_ERROR-MSGID                  SSFCOMPOSER
    L_ERROR-MSGV1                  YTI_FCR004_RETREP_TYPE

  • Error while determining the form function module

    Hi everyone,
    We are experiencing problems while displaying one adobe form in ESS. It’s the Travel Expense form (PTRV_EXPENSE_FORM). When pressing the button to “Display/Print” the form we get an error message: "Error while determining the form function module", and no form I shown. The ADS server is configured correctly and there are other forms that are actually working, for example the Travel Request form. We are running WAS 7.0 with SP12.
    Anyone has an idea what can cause the problem? Any help is greatly appreciated.
    Thanks in advance!
    Regards,
    Sophie

    Viktor,
    Thank you for your answer, it solved our problem!
    Regards,
    Sophie

  • Any1 aware of a function module to convert a number in exponential form

    any1 aware of a function module to convert a number in exponential form to normal form...
    eg... a no. like 8.00000000000004E-01 
                     8.88888888888884E-01
    and
    a no. like 1.50000000000000E+00 
               9.44444444444442E-01

    I think you can just move from type F to type p.
    p =  f .
    Regards,
    Rich Heilman

Maybe you are looking for