Function Module or Method needed to Convert Nodes?

When I read hierarchies of nodes, the first parent node can be lets say 3, its children are 2. Old logic the I have expects 0, not three for the parent. I can write some logic to convert all but wondering if their was an SAP FM or method I could use instead.
     Thank-You

Hi Vishnu,
Have a look at this FM.
<b>CO_MP_CREATE_PURCHASE_ORDER</b>
and also this
<b>OIO_RS_M_CREATE_PURCHASE_ORDER</b>
<b>Reward points if this helps,</b>
Kiran

Similar Messages

  • Function module or Method for changing a program with transport

    Hi,
    Can anybody please let me know if there is any Function module or Method to change a program under a Transport request
    (so it needs to go to next Version for the program).  I tried using
    INSERT REPORT .... with all options for this command. It is changing the program successfully but all are creating the program locally.
    I successfully found CIF_PROGRAM_INSERT for creating new program under a TR.
    But struggling a lot to find the same kind of FM or Method to change a program.
    Can anybody help?
    //Kothand

    Hi,
    Thanks. But i am asking for a Function module which can edit a program and keep it inside a Transport request.
    This FM is to import any change request.
    //Kothand

  • How to Send Internal table to SAP Spool using Function Modules or Methods?

    Hi Experts,
    How to Send Internal table to SAP Spool using Function Modules or Methods?
    Thanks ,
    Kiran

    This is my code.
    I still get the no ABAP list data for the spool, even tho I can see it sp01?
    REPORT  Z_MAIL_PAYSLIP.
    * Declaration Part *
    tables: PERNR, PV000, T549Q, V_T514D, HRPY_RGDIR.
    infotypes: 0000, 0001, 0105, 0655.
    data: begin of ITAB occurs 0,
      MTEXT(25) type C,
      PERNR like PA0001-PERNR,
      ABKRS like PA0001-ABKRS,
      ENAME like PA0001-ENAME,
      USRID_LONG like PA0105-USRID_LONG,
    end of ITAB.
    data: W_BEGDA like HRPY_RGDIR-FPBEG,
          W_ENDDA like HRPY_RGDIR-FPEND.
    data: RETURN like BAPIRETURN1 occurs 0 with header line.
    data: P_INFO like PC407,
          P_FORM like PC408 occurs 0 with header line.
    data: P_IDX type I,
          MY_MONTH type T549Q-PABRP,
          STR_MY_MONTH(2) type C,
          MY_YEAR type T549Q-PABRJ,
          STR_MY_YEAR(4) type C,
          CRLF(2) type x value '0D0A'.
    data: W_CMONTH(10) type C.
    data: TAB_LINES type I,
          ATT_TYPE like SOODK-OBJTP.
    data: begin of P_INDEX occurs 0,
            INDEX type I,
    end of P_INDEX.
    constants: begin of F__LTYPE, "type of line
       CMD like PC408-LTYPE value '/:',  "command
       TXT like PC408-LTYPE value 's',   "textline
    end of F__LTYPE.
    constants: begin of F__CMD, "commands
      NEWPAGE like PC408-LINDA value '',
    end of F__CMD.
    data: P_LIST like ABAPLIST occurs 1 with header line.
    *data: OBJBIN like SOLISTI1 occurs 10 with header line,
    data: OBJBIN like  LVC_S_1022 occurs 10 with header line,
          DOCDATA like SODOCCHGI1,
          OBJTXT like SOLISTI1 occurs 10 with header line,
          OBJPACK like SOPCKLSTI1 occurs 1 with header line,
          RECLIST like SOMLRECI1 occurs 1 with header line,
          OBJHEAD like SOLISTI1 occurs 1 with header line,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_buffer type string,
          l_no_of_bytes TYPE i,
          l_pdf_spoolid LIKE tsp01-rqident,
          l_jobname     LIKE tbtcjob-jobname.
    data: file_length  type int4,
          spool_id     type rspoid,
          line_cnt     type i.
    *-------------------------------------------------------------------* * INITIALIZATION *
    OBJBIN = ' | '.
    append OBJBIN.
    OBJPACK-HEAD_START = 1.
    data: S_ABKRS like PV000-ABKRS.
    data: S_PABRP like T549Q-PABRP.
    data: S_PABRJ like T549Q-PABRJ.
    * SELECTION SCREEN                                                  *
    selection-screen begin of block BL1.
    parameters: PAY_VAR like BAPI7004-PAYSLIP_VARIANT default 'ESS_PAYSLIPS' obligatory.
    selection-screen end of block BL1.
    START-OF-SELECTION.
      s_ABKRS = PNPXABKR.
      S_PABRP = PNPPABRP.
      s_pabrj = PNPPABRJ.
      w_begda = PN-BEGDA.
      w_endda = PN-ENDDA.
    get pernr.
    *                                 "Check active employees
      rp-provide-from-last p0000 space pn-begda  pn-endda.
      CHECK P0000-STAT2 IN PNPSTAT2.
    *                                 "Check Payslip Mail flag
      rp-provide-from-last p0655 space pn-begda  pn-endda.
      CHECK P0655-ESSONLY = 'X'.
      rp-provide-from-last p0001 space pn-begda  pn-endda.
    *                                 "Find email address
      RP-PROVIDE-FROM-LAST P0105 '0030' PN-BEGDA PN-ENDDA.
      if p0105-usrid_LONG ne ''.
        ITAB-PERNR      = P0001-PERNR.
        ITAB-ABKRS      = P0001-ABKRS.
        ITAB-ENAME      = P0001-ENAME.
        ITAB-USRID_LONG = P0105-USRID_LONG.
        append itab.
        clear itab.
      endif.
      "SY-UCOMM ='ONLI'
    END-OF-SELECTION.
    *------------------------------------------------------------------* start-of-selection.
      write : / 'Payroll Area        : ', S_ABKRS.
      write : / 'Payroll Period/Year : ',STR_MY_MONTH,'-',STR_MY_YEAR. write : / 'System Date : ', SY-DATUM.
      write : / 'System Time         : ', SY-UZEIT.
      write : / 'User Name           : ', SY-UNAME.
      write : / SY-ULINE.
      sort ITAB by PERNR.
      loop at ITAB.
        clear : P_INFO, P_FORM, P_INDEX, P_LIST, OBJBIN, DOCDATA, OBJTXT, OBJPACK, RECLIST, TAB_LINES.
        refresh : P_FORM, P_INDEX, P_LIST, OBJBIN, OBJTXT, OBJPACK, RECLIST.
    *                                                  Retrieve Payroll results sequence number for this run
        select single * from HRPY_RGDIR where PERNR eq ITAB-PERNR
                                        and FPBEG ge W_BEGDA
                                        and FPEND le W_ENDDA
                                        and SRTZA eq 'A'.
    *                                                  Produce payslip for those payroll results
        if SY-SUBRC = 0.
          call function 'GET_PAYSLIP'
            EXPORTING
              EMPLOYEE_NUMBER = ITAB-PERNR
              SEQUENCE_NUMBER = HRPY_RGDIR-SEQNR
              PAYSLIP_VARIANT = PAY_VAR
            IMPORTING
              RETURN          = RETURN
              P_INFO          = P_INFO
            TABLES
              P_FORM          = P_FORM.
          check RETURN is initial.
    *                                                 remove linetype from generated payslip
          loop at p_form.
            objbin = p_form-linda.
            append objbin.
            line_cnt = line_cnt + 1.
          endloop.
          file_length = line_cnt * 1022.
    *                                                 create spool file of paylsip
          CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
            EXPORTING
              i_file_length = file_length
            IMPORTING
              e_spoolid     = spool_id
            TABLES
              it_textdata   = objbin.
          IF sy-subrc EQ 0.
            WRITE spool_id.
          ENDIF.
          DESCRIBE table objbin.
          DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
          CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
            EXPORTING
              SRC_SPOOLID                    = spool_id
              NO_DIALOG                      = ' '
              DST_DEVICE                     = 'MAIL'
    *      PDF_DESTINATION                =
    *    IMPORTING
    *      PDF_BYTECOUNT                  = l_no_of_bytes
    *      PDF_SPOOLID                    = l_pdf_spoolid
    *      LIST_PAGECOUNT                 =
    *      BTC_JOBNAME                    =
    *      BTC_JOBCOUNT                   =
            TABLES
              PDF                            = pdf
            EXCEPTIONS
              ERR_NO_ABAP_SPOOLJOB           = 1
              ERR_NO_SPOOLJOB                = 2
              ERR_NO_PERMISSION              = 3
              ERR_CONV_NOT_POSSIBLE          = 4
              ERR_BAD_DESTDEVICE             = 5
              USER_CANCELLED                 = 6
              ERR_SPOOLERROR                 = 7
              ERR_TEMSEERROR                 = 8
              ERR_BTCJOB_OPEN_FAILED         = 9
              ERR_BTCJOB_SUBMIT_FAILED       = 10
              ERR_BTCJOB_CLOSE_FAILED        = 11
              OTHERS                         = 12
          IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *Download PDF file C Drive
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'C:\itab_to_pdf.pdf'
          filetype = 'BIN'
        TABLES
          data_tab = pdf.
    * Transfer the 132-long strings to 255-long strings
    *  LOOP AT pdf.
    *    TRANSLATE pdf USING ' ~'.
    *    CONCATENATE gd_buffer pdf INTO gd_buffer.
    *  ENDLOOP.
    *  TRANSLATE gd_buffer USING '~ '.
    *  DO.
    *    it_mess_att = gd_buffer.
    *    APPEND it_mess_att.
    *    SHIFT gd_buffer LEFT BY 255 PLACES.
    *    IF gd_buffer IS INITIAL.
    *      EXIT.
    *    ENDIF.
    *  ENDDO.
          OBJHEAD = 'Objhead'.
          append OBJHEAD.
    * preparing email subject
          concatenate W_ENDDA(6)
                    ' Payslip-'
                    ITAB-ENAME+0(28)
                    ITAB-PERNR+4(4) ')'
                 into DOCDATA-OBJ_DESCR.
          DOCDATA-OBJ_NAME = 'Pay Slip'.
          DOCDATA-OBJ_LANGU = SY-LANGU.
          OBJTXT = 'Pay Slip.'.
          append OBJTXT.
    *prepare email lines
          OBJTXT = DOCDATA-OBJ_DESCR.
          append OBJTXT.
          OBJTXT = 'Please find enclosed your current payslip.'.
          append OBJTXT.
    * Write Attachment(Main)
    * 3 has been fixed because OBJTXT has fix three lines
          read table OBJTXT index 3.
    *    DOCDATA-DOC_SIZE = ( 3 - 1 ) * 255 + strlen( OBJTXT ).
          clear OBJPACK-TRANSF_BIN.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = 3.
          OBJPACK-DOC_TYPE = 'RAW'.
          append OBJPACK.
    * Create Message Attachment
          ATT_TYPE = 'PDF'.
          describe table OBJBIN lines TAB_LINES.
          read table OBJBIN index TAB_LINES.
    *    OBJPACK-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + strlen( OBJBIN ).
          OBJPACK-TRANSF_BIN = 'X'.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = TAB_LINES.
          OBJPACK-DOC_TYPE = ATT_TYPE.
          OBJPACK-OBJ_NAME = 'ATTACHMENT'.
          OBJPACK-OBJ_DESCR = 'Payslip'.
          append OBJPACK.
    * Create receiver list refresh RECLIST.
          clear RECLIST.
          RECLIST-RECEIVER = itab-USRID_long.
          translate RECLIST-RECEIVER to lower case.
          RECLIST-REC_TYPE = 'U'.
          append RECLIST.
    * Send the document
    *SO_NEW_DOCUMENT_ATT_SEND_API1
          call function 'SO_DOCUMENT_SEND_API1'
            exporting
              DOCUMENT_DATA = DOCDATA
              PUT_IN_OUTBOX = 'X'
              COMMIT_WORK = 'X'
    * IMPORTING
    *   SENT_TO_ALL =
    *   NEW_OBJECT_ID =
            tables
              PACKING_LIST  = OBJPACK
              OBJECT_HEADER = OBJHEAD
              CONTENTS_BIN  = pdf
              CONTENTS_TXT  = OBJTXT
    *   CONTENTS_HEX =
    *   OBJECT_PARA =
    *   OBJECT_PARB =
              RECEIVERS = RECLIST
            exceptions
              TOO_MANY_RECEIVERS = 1
              DOCUMENT_NOT_SENT = 2
              DOCUMENT_TYPE_NOT_EXIST = 3
              OPERATION_NO_AUTHORIZATION = 4
              PARAMETER_ERROR = 5
              X_ERROR = 6
              ENQUEUE_ERROR = 7
              others = 8.
          if SY-SUBRC NE 0.
            ITAB-MTEXT = 'Message Not Sent to : '.
          else.
            ITAB-MTEXT = 'Message Sent to : '.
          endif.
    *    else.
    *      ITAB-MTEXT = 'Message Not Sent to : '.
    *    endif.
        else.
          "SY-SUBRC Not = 0
          ITAB-MTEXT = 'Payroll data not found : '.
        endif.
        "end of SY-SUBRC = 0.
        modify ITAB.
      endloop. "end loop at ITAB
      sort ITAB by MTEXT PERNR.
      loop at ITAB.
        at new MTEXT.
          uline.
          write : / ITAB-MTEXT color 4 intensified on.
          write : / 'Emp. Code' color 2 intensified on,
                 12 'Emp. Name' color 2 intensified on,
                 54 'Email ID' color 2 intensified on.
        endat.
        write : / ITAB-PERNR, 12 ITAB-ENAME, 54 ITAB-USRID_LONG.
      endloop.

  • Process an Interactive Form in a function module or method

    Hello,
    If I process an interactive form in a report everthing works fine. But when I execute the same coding in a function module or method nothing works! The call of the function module fm_name returns sy-subrc = 1 (usage error).
    I believe that function call of 'FP_JOB_OPEN' cause the problems. I can't spool this job in an function module or method.
    What can I do for using interactive Forms in a method.
    If anybody had the same problem a piece of of coding will help.
    Thanks a lot in advance
    Roger
    CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
      EXPORTING
        i_name     = 'Z_EXPORT_FORM_01'
      IMPORTING
        e_funcname = fm_name.
    Set output parameters and open spool job
    fp_outputparams-nodialog = 'X'. " suppress printer dialog popup
    fp_outputparams-getpdf = 'X'. " launch print preview
    CALL FUNCTION 'FP_JOB_OPEN'
      CHANGING
        ie_outputparams = fp_outputparams
      EXCEPTIONS
        cancel          = 1
        usage_error     = 2
        system_error    = 3
        internal_error  = 4
        OTHERS          = 5.
    Set form language and country (->form locale)
    fp_docparams-langu     = 'E'.
    fp_docparams-country   = 'US'.
    fp_docparams-fillable  = 'X'.
    call the generated function module
    CALL FUNCTION fm_name
      EXPORTING
        /1bcdwb/docparams    = fp_docparams
        /vwk/z_tla_vw_export = wa_z_export
        it_vehicle           = lt_vehicle
        ddinit               = ddinit
        ddcomplaint          = ddcomplaint
        ddinformation        = ddinformation
        ddpraise             = ddpraise
        ddidea               = ddidea
      IMPORTING
        /1bcdwb/formoutput   = fp_formoutput
      EXCEPTIONS
        usage_error          = 1
        system_error         = 2
        internal_error       = 3
        OTHERS               = 4.

    Yes I did.
    I have written the code as given below. It is not working either. Can you please check my code.
    DATA:
          FM_NAME TYPE RS38L_FNAM,
          FP_DOCPARAMS      TYPE SFPDOCPARAMS,
          FP_OUTPUTPARAMS   TYPE SFPOUTPUTPARAMS.
    fp_outputparams-nodialog = 'X'.
    fp_outputparams-getpdf = 'X'.
    CALL FUNCTION 'FP_JOB_OPEN'
    CHANGING
    ie_outputparams = fp_outputparams
    EXCEPTIONS
    cancel = 1
    usage_error = 2
    system_error = 3
    internal_error = 4
    OTHERS = 5.
    Get the name of the generated function module
    CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
    EXPORTING
    i_name = 'ZHR_APPT'
    IMPORTING
    e_funcname = fm_name.
    Set form language and country (->form locale)
    fp_docparams-langu = 'E'.
    fp_docparams-country = 'US'.
    fp_docparams-fillable = 'X'.
    call the generated function module
    CALL FUNCTION FM_NAME
        EXPORTING
          /1BCDWB/DOCPARAMS        = FP_DOCPARAMS
          T_HR                     = wa_emphr1
       IMPORTING
        /1BCDWB/FORMOUTPUT       =
        EXCEPTIONS
          USAGE_ERROR           = 1
          SYSTEM_ERROR          = 2
          INTERNAL_ERROR           = 3.
    Thx,
    John

  • Hierarchy Function Modules (or Methods)?

    I am trying to retrieve all hierarchies, and their children nodes, below a main node. Is there a function module in SEM/BCS for doing this?
    Are there other function modules that come in handy with hierarchies?
          Thank-You.

    There isn't a single FM that I'm aware of.  You can piggy back the standard BCS functionality and acheive something similar.
    You need to know period, year, version and fiscal year variant. 
    Then...for this structure:
    CG1
    - CG2
    - CG3
    - - CG4
    you can pass CG1 as your "parent" and retreive CG2, CG3, and CG4 as selections (according to date-from date-to in your CG master data).
    I'll try to include the relevant section for this (it's from a number of methods in a class I created for an outbound interface)....I'm sure I don't have all the data declarations, and I might have a few unnecessary sections.
    global variables
      data DO_AREA type ref to IF_UC_AREA .
      data DO_MODEL type ref to IF_UC_MODEL .
      data DO_MD_FACTORY type ref to IF_UG_MD_FACTORY .
    initialize objects
    *** method for initialize objects
      DATA:
      lo_factory        TYPE REF TO if_ug_md_factory,
      lo_char           TYPE REF TO if_ug_md_char,
      lo_value          TYPE REF TO if_ug_md_char_value,
      lt_field_val      TYPE ugmd_ts_field_val,
      ls_field_val      TYPE ugmd_s_field_val.
    * Initialize master data factory
      CALL METHOD cl_uc_area=>if_uc_area~get_md_factory
        EXPORTING
          i_area        = c_cons_area
        IMPORTING
          eo_md_factory = lo_factory.
      do_md_factory = lo_factory.
    * get area object, if it's not set
      IF do_area IS NOT BOUND.
        lo_char = do_md_factory->get_char_instance(
            i_fieldname = uc00_cs_fld-area ).
        ls_field_val-fieldname = uc00_cs_fld-area.
        ls_field_val-value     = c_cons_area.
        INSERT ls_field_val INTO TABLE lt_field_val.
        lo_value = lo_char->get_value_instance(
           it_value = lt_field_val ).
        do_area   ?= lo_value.
    *   get data model
        IF do_model IS NOT BOUND.
          CALL METHOD do_area->get_model
            IMPORTING
              eo_model = do_model.
        ENDIF.
      ENDIF.
    determine lower level consolidation groups
    **Include lower level consolidation group nodes in cube selection.
      DATA:
      lo_context           TYPE REF TO if_uc_context,
      lt_value             TYPE uc0_ts_value,
      ls_value             TYPE uc0_s_value,
      ls_o_sel             TYPE uct_sx_sel,
      lt_sel               TYPE uc0_ts_sel,
      ls_sel               TYPE uc0_s_sel,
      ls_sid               TYPE ucd_s_sid,
      ls_sel_node          TYPE uc0_s_sel_node_sid,
      lt_sel_node          TYPE uc0_ts_sel_node_sid,
      lt_o_sel             TYPE uct_t_sel.
      CLEAR lt_value.
      ls_value-fieldname = c_cgcomp_fieldname. ' /1FB/SEM_CGCOMP
      ls_value-value = i_sem_cgcomp.           ' "parent" consolidation group
      APPEND ls_value TO lt_value.
      CALL METHOD do_model->do_sidmap->convert_value_to_sid
        EXPORTING
          i_fieldname = c_cgcomp_fieldname
          it_value    = lt_value
        IMPORTING
          es_sid      = ls_sid
        EXCEPTIONS
          not_found   = 1
          OTHERS      = 2.
      CLEAR lt_sel_node.
      ls_sel_node-fieldname =  c_cgcomp_fieldname.
      ls_sel_node-sign      = uc00_cs_ra-sign_i.
      ls_sel_node-s_node    = ls_sid.
      INSERT ls_sel_node INTO TABLE lt_sel_node.
      CLEAR lt_sel.
      CLEAR lt_value.
      CALL METHOD do_model->do_data_factory->create_sel
        EXPORTING
          it_node_sid = lt_sel_node
        RECEIVING
          eo_sel      = ls_o_sel-o_sel.
      APPEND ls_o_sel TO lt_o_sel.
      CLEAR ls_value.
      ls_value-fieldname = '/1FB/CS_VERSION'.     " CS Version
      ls_value-value = g_cs_version.
      APPEND ls_value TO lt_value.
      CLEAR ls_value.
      ls_value-fieldname = '/BIC/BCS_VERS'.          " Custom Version
      ls_value-value = g_bcs_vers.
      APPEND ls_value TO lt_value.
      CLEAR ls_value.
      ls_value-fieldname = 'FISCPERIOD'.
      ls_value-value = g_fiscperiod.
      APPEND ls_value TO lt_value.
      CLEAR ls_value.
      ls_value-fieldname = 'FISCVARNT'.
      ls_value-value = g_fiscvarnt.
      APPEND ls_value TO lt_value.
      CLEAR ls_value.
      ls_value-fieldname = 'FISCYEAR'.
      ls_value-value = g_fiscyear.
      APPEND ls_value TO lt_value.
      CALL METHOD do_model->derive_context
        EXPORTING
          it_value     = lt_value
        IMPORTING
          eo_context   = lo_context
        EXCEPTIONS
          info_missing = 1
          OTHERS       = 2.
      CALL METHOD ls_o_sel-o_sel->set_context
        EXPORTING
          io_context = lo_context.
      CALL METHOD ls_o_sel-o_sel->get_sel
        IMPORTING
          et_sel = lt_sel.
    * lt_sel will contain the lower-level consolidation groups, beneath the "parent" consolidation group (i_sem_cgcomp)
    * Add cons groups to selection criteria
      DELETE gt_range WHERE chanm = c_objnm_cgcomp.   ' 0SEM_CGCOMP
      LOOP AT lt_sel INTO ls_sel.
        CLEAR  gs_range.
        gs_range-chanm  = c_objnm_cgcomp.   ' 0SEM_CGCOMP
        gs_range-sign   = ls_sel-sign.
        gs_range-compop = ls_sel-option.
        gs_range-low    = ls_sel-low.
        gs_range-high   = ls_sel-high.
        APPEND gs_range TO gt_range.
      ENDLOOP.
    Hope that helps...if not, you might be able to do a find for some of the sections of the code to find exactly how SAP is doing (I can only say that this functionality worked in my situation, not sure it works in all consolidation scenarios).  FYI - I was using this to read from the virtual cube in a custom task in order to outbound consolidated results.
    - Chris

  • How to call ABAP function module/ class method through web service?

    Hi Colleagues,
    I need to write an iphone version of current ABAP program. I want to call ABAP method and function module through my iphone so that I can re-use the ABAP APIs.So I choose web service. Can you give me any details information about how to do that?
    Thank you very much

    Hi,
    you need to create webservice out of FM. goto SE80 and follow the webservice creation wizard. Finally use webservice url for calling FM (remote enabled) from your iPhone.
    Regards,
    Gourav

  • How to call function module/ class method of another system.

    Suppose now i am working in System A. And i need to check the system Status of System B, System C, System D....
    my design is to provide an interface. and each system realize the interface individually.now my question is how cani call the interface, because they are in different systems.
    of course i know about the host name, port and logon information over these systems.
    who can give my some suggestions or other solutions.
    thanks in advance.
    Johnney.

    Hello,
    If u want to call a FM of the other system then that FM should be a RFC enable on one.
    <b>CALL FUNCTION func DESTINATION dest.</b>
    Effect
    Executes the function module from an external source (as a Remote Function Call or RFC); dest can be a literal or a variable.
    Depending on the specified destination, the function module is executed in another R/3 or R/2 System. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
    Since each destination defines its own program context, further calls to the same or different function modules with the same destination can access the local memory (global data) of these function modules.
    To maintain existing destinations, choose Tools -> Administration, Administration -> Network -> RFC destinations
    Note
    Under certain circumstances, an RFC may trigger a database commit. For this reason, RFCs must not be used between pairs of SQL statements that open and close a database cursor (such as SELECT... ENDSELECT).
    Vasanth

  • Difference between Function Module Vs Method in Class Module

    1) Can you please tell the difference between the Function module used in abap program and the method of the class module used in abap programming.
    2) does it necessary to do commit statement after calling the function module.
    Thankyou for you time.
    Bhaskar.

    Hi,
    1)
    Check this difference..
    The main difference between real object orientation and function groups is that although a program can work with the instances of several function groups at the same time, it cannot work with several instances of a single function group. Suppose a program wanted to use several independent counters, or process several orders at the same time. In this case, you would have to adapt the function group to include instance administration, for example, by using numbers to differentiate between the instances.
    2) COMMIT WORK is required for BAPI..And not required when you normally call a function module..Unless required ..
    Example
    Update function modules requires COMMIT WORK to execute the function module.
    Thanks,
    Naren

  • Function Modules or Methods to Retrieve texts in Material Master

    Hi All,
    Can you get me a list of Function Modules which retrieve the text from Material Master.
    My requirement is to extract texts:
    Basic Text - at material level
    Purchase Order text - at material level
    Sales Texts - at material-sales org level
    Thanks in Advance.
    Sure Points for all Valuable answers
    Regards
    Vinayak

    hi
          u can get using read_text FM ask ur functionl person to give you the ID and other details required..
    u can also get it from STXH table... from which even the FM gets data..

  • BOR object cannot use function module as method

    Hi All,
    I have a function module with an import parameter referring to data element DE_ABC. BOR indicates that it doesn't support this data type. However, if I define a DB table with a field whose type is DE_ABC and use that field as reference in FM interface definition, that FM can be used by the BOR object. Does anybody have any idea about this issue?
    Best Regards
    Jerome

    Hello,
    Please always mention version. It may help if you told us what data type, but to give a theoretical answer I'd say this would be correct behaviour.
    BOR is old, it was created to bring some kind of OO to then procedural ABAP. It has also not changed much, therefore doesn't support some of the newer data types. On the other hand it doesn't look at the components of a structure, so placing an unsupported element into a structure is a perfect workaround.
    Be careful however when using deep structures or one of the variable length types such as STRING. As I use classes most of the time I have no idea how they would behave but a quick test should verify whether it works.
    Hope that helps,
    Mike

  • Help on Code for functional module generic extraction - needed.

    Hi Experts,
    Can you pleaese help  me on : how to pass data to the structure created.
      How to fill the structure in functional module  extraction (structure) from i_t_final to e_t_data.
    we are using include programe in the extraction.
    help appreciated.
    Thanks Much
    kannan

    Hi Shreem,
    Check if the following SDN Article link is helpful.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c062a3a8-f44c-2c10-ccb8-9b88fbdcb008?QuickLink=index&overridelayout=true
    http://www.erphowtos.com/guides-a-tutorials/doc_view/534-generic-extraction-using-function-module-fm.html
    Best Regards,
    Kush Kashyap

  • Regarding Function modules and methods

    Hi,
    which of these calls to GUI_UPLOAD is more efficient?
    CALL METHOD cl_gui_frontend_services=>gui_upload
    or
    CALL FUNCTION GUI_UPLOAD

    both does the same job. if you look at the code inside the method cl_gui_frontend_services=>gui_upload
    it would be calling GUI_UPLOAD function.
    in terms of performance efficiency, there will be a very negligible differece and call function will be slightly better in my opinion.
    Regards
    Raja

  • Want to create a function module  which will convert smartform into PDF .

    Hi All ,
    Requirement : I want to create a function module/report  which will convert smartform into PDF .
    Thanks in advance

    Hi All ,
    zsuresh_test : for converting smartform into pdf.
    when I am excuting this report(zsuresh_test) and by passing the smartform name FOPCR_STANDARD_F1
    I am getting error :
    Incorrect parameter with CALL FUNCTION
    Can you  please help me out..
    REPORT zsuresh_test.
    Variable declarations
    DATA:
    w_form_name TYPE tdsfname VALUE 'FOPCR_STANDARD_F1',
    w_fmodule TYPE rs38l_fnam,
    w_cparam TYPE ssfctrlop,
    w_outoptions TYPE ssfcompop,
    W_bin_filesize TYPE i, " Binary File Size
    w_FILE_NAME type string,
    w_File_path type string,
    w_FULL_PATH type string.
    Internal tables declaration
    Internal table to hold the OTF data
    DATA:
    t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    Internal table to hold OTF data recd from the SMARTFORM
    t_otf_from_fm TYPE ssfcrescl,
    Internal table to hold the data from the FM CONVERT_OTF
    T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    This function module call is used to retrieve the name of the Function
    module generated when the SMARTFORM is activated
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = w_form_name
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    fm_name = w_fmodule
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Calling the SMARTFORM using the function module retrieved above
    GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
    format of the output
    w_cparam-no_dialog = 'X'.
    w_cparam-preview = space. " Suppressing the dialog box
    " for print preview
    w_cparam-getotf = 'X'.
    Printer name to be used is provided in the export parameter
    OUTPUT_OPTIONS
    w_outoptions-tddest = 'LP01'.
    CALL FUNCTION w_fmodule
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    control_parameters = w_cparam
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    output_options = w_outoptions
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    job_output_info = t_otf_from_fm
    JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    t_otf[] = t_otf_from_fm-otfdata[].
    Function Module CONVERT_OTF is used to convert the OTF format to PDF
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    ARCHIVE_INDEX = ' '
    COPYNUMBER = 0
    ASCII_BIDI_VIS2LOG = ' '
    PDF_DELETE_OTFTAB = ' '
    IMPORTING
    BIN_FILESIZE = W_bin_filesize
    BIN_FILE =
    TABLES
    otf = T_OTF
    lines = T_pdf_tab
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    ERR_BAD_OTF = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    To display File SAVE dialog window
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
    WINDOW_TITLE =
    DEFAULT_EXTENSION =
    DEFAULT_FILE_NAME =
    FILE_FILTER =
    INITIAL_DIRECTORY =
    WITH_ENCODING =
    PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = w_FILE_NAME
    path = w_FILE_PATH
    fullpath = w_FULL_PATH
    USER_ACTION =
    FILE_ENCODING =
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 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.
    Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
    presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = W_bin_filesize
    filename = w_FULL_PATH
    FILETYPE = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    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 = T_pdf_tab
    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.
    ENDIF.

  • Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format

    Can any one tell me Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format?

    have a look at the WIKI FAQs...they are very useful
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapDevelopmentand+Programming&
    For this it says:
    <i>How to convert a date to internal or external format?
    Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL
    to convert the date. When converting to external format, the date format from the user's user profile will be used. When converting to internal format, the result will be in YYYYMMDD format.</i>

  • Calling a Selection Screen from a Function Module/Method

    Hi,
      I would like to call a selection screen from a function module or method. I understand it is not possible by the definition. Are there any alternative options as I am looking for the Variants Save option on the screen. Any thoughts?
    Thanks
    Raghav

    Since i don't know your exact requirements (standard SAP selection screen? your own selection screen?) the onl;y thing i can come up with is:
    1. in your function pool create your own screen with a subscreen area
    2. create your own selection screen as a subscreen.
    3. include the selection subscreen in the first screen
    4. call the first screen in your function.

Maybe you are looking for

  • Looking for a IPad Game App

    HI I am look my for a iPad Game Apps. Is there a Scrabble/Words with Friends type Games (That are Similar) where you can use First Bames and the Names of Countries?

  • Flash CS5 problem - missing text

    We've got several Flash files created by a partner organization that we're trying to edit. The files are for an e-learning course and contain four or five "tabs," each with a multiple choice or true/false question, each option labeled A, B, C, etc..

  • InDesign.exe CS5 crashes on exit

    I have a marketing user here who has an annoying, but not a showstopping error every time she closes InDesign. InDesign CS5 works fine, but when she is done and closes out, it causes this message: DDE Server Window: InDesign.exe - Application Error T

  • How to make Texts field in customer master record as mandatory

    Hello all, While creating customer master , I have added few Text ID's and texts using Extras -->Texts option . I want to make one of the "text Id"  field  as mandatory while creating customer master. Any suggestions? Thanks, Sre

  • Data guard LOG_FILE_NAME_CONVERT

    Hello , LOG_FILE_NAME_CONVERT parameter in data guard is for archive log files or online redo log files? Thank you/ allahmorad