BAPI return message problem

Hi All,
I created BAPI for Sale order the order created successfully but the return message S -success  is not coming- but the error message the sale order is already exist. How to solve this. I used the returnmessage for BAPI - BAPIRETURN1.
Thanks,
Suresh Maniarasu
Edited by: suresh maniarasu on May 23, 2009 12:20 PM

Well S  is not coming because there is no Success. Its giving error that Order already exists in system. Seems like straightforward condition.

Similar Messages

  • How to display BAPI return message as a pop up

    Hi,
    I am able to get BAPI return message but my requirement is to display these BAPI return messages as pop up's like alerts in javascript.
    I am using abstract portal component.
    any suggestions.
    Regards
    Praveen

    Hi,
    Place a hidden field in your abstract portal component like this:
    <input type ="hidden" name ="returnedmessage" value=<i>the variable returned from JCO</i>>
    In addition to this:
    <script language = "javascript">
    if (document.<i>formname</i>.returnedmessage.value != null || document.<i>formname</i>.returnedmessage.value != "")
    alert(document.<i>formname</i>.returnedmessage.value);
    </script>
    If you are transferring your code to a JSP it would less cumbersome else you would have to enclose all this in response.write(); statements.
    Regards,
    Prem

  • How to handle BAPI RETURN message?

    Hi ,
    I developed a bapi ,it is calling from java  application . i don't konw how to send the return message to java application .Pl any one help out this problem.
    Thanks&Regards,
    Pratap

    bapi's normally have a return parameter of type BAPIRETURN (structure) or BAPIRET (internal table) that contain the result messages from a bapi. So if you develop your own bapi you should add this kind of export parameter.
    regards,
    Hans

  • BAPI return message

    Hi,
    I am trying to use 'BAPI_INQUIRY_CREATEFROMDATA2' to create Inquiries. It is creating successfully. But if there any pricing errors like 'Pricing error: Mandatory condition SRP5 is missing', it is not giving this return message but instead giving generic return message saying 'The sales document is not yet complete: Edit data'.
    If we use BDC to create the Inquiry, if the same problem happens, it does gives the specific return message ('Pricing error: Mandatory condition SRP5 is missing').
    Is there a way to get this specific return message from the BAPI as well?
    Thanks..
    Swetha.

    Hi Swetha ,
    BAPI is a kind of direct table update and BDC is creation of data thro' screen validation. So SAP take cares of all the validation when you run the BDC, but in case of BAPI, you will always get these kinds of message which are hard to interpreter. Also there is no way to manipulate these messages.
    Thanks,
    Mandar

  • Popup BAPI return messages

    Hello experts,
    I would like a way to quickly handle the BAPI return table (TYPE TABLE OF bapiret2).  I would like to pass the table into a function module or helper method to popup all the messages at once.  This is the same way MIGO (and many other programs) do a popup of messages with little red, yellow, and green icons to the left.  Currently I am using a series of calls to function module BAL_LOG_... and I feel there has to be a better way.
    I tried searching for the answer to this question, but if the answer exists, it is buried within the noise of a million people saying use 'POPUP_TO_CONFIRM' and other function modules.  To clarify: I do not want buttons to confirm.  I want a popup of a list of messages with red, yellow, and green icons on the left.
    Whoever answers my question correctly will henceforth be referred to by me as "the Magnificent."

    My 2 cents ...
    IF_RECA_MESSAGE_LIST is the most convenient message handler i have used so far So i would use it in this way -
    Get the instance using the factory class CF_RECA_MESSAGE_LIST=>CREATE( ).
    Add the BAPI messages using the method ADD_FROM_BAPI( ).
    Get the handle via GET_HANDLE( ) & display using function BAL_DSP_LOG_DISPLAY.
    DATA(o_msg_list) = cf_reca_message_list=>create( ).
    o_msg_list->add_from_bapi(
      EXPORTING
        it_bapiret = VALUE #( id = 'BC_IBF'
                            ( type = 'I'  number = '008' )
                              type = 'E' ( number = '050' message_v1 = 'AA')
                                         ( number = '051' message_v1 = 'BB')
                                         ( number = '055' message_v1 = 'CC')
    DATA st_log_disp_prof TYPE bal_s_prof.
    CALL FUNCTION 'BAL_DSP_PROFILE_POPUP_GET'
      IMPORTING
        e_s_display_profile = st_log_disp_prof.
    st_log_disp_prof-use_grid   = abap_true.
    st_log_disp_prof-disvariant
      = VALUE #( handle = o_msg_list->get_handle( )
                 report = sy-repid
    CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
      EXPORTING
        i_s_display_profile  = st_log_disp_prof
      EXCEPTIONS
        profile_inconsistent = 1
        internal_error       = 2
        no_data_available    = 3
        no_authority         = 4
        OTHERS               = 5.
    IF sy-subrc <> 0.
    * Implement suitable error handling here
    ENDIF.
    BR,
    Suhas

  • BAPI return messages.

    Hi,
    When we create a sale order manually using VA01 tcode, we will be getting messages like 'material entered is critical part' or when the customer is on credit hold we will be getting 'Credit check maximum document value exceed'.
    My problem is i am not getting these messages in my return table when i create a sale order using 'SD_SALESDOCUMENT_CREATE'. Whether there is any value we need to pass in the import to get all the messages type S, I, W in our return table.
    Please let me know the solution.
    It's very urgent.
    Thanks,
    Srinath S.

    after my bapi call.
    i gave append <my_ret_table>.
    eg:
      CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
        EXPORTING
          sales_header_in     = header
        IMPORTING
          salesdocument_ex    = sales_doc
          sales_header_out    = header_out
          sales_header_status = header_status
        TABLES
          return              = bapireturn
          sales_items_in      = sditm
          sales_items_inx     = sditmx
          sales_partners      = parnr
          sales_schedules_in  = sch
          items_ex            = item
          schedule_ex         = schedule
          business_ex         = business.
    APPEND bapireturn..
    but the last message is appended again.

  • Write BAPI return messages into text

    Dear experts,
                  I want to write error messages into a text file. i tried in many ways like, using GUI_DOWNLOAD i converted messages to non sap but it creates only empty text file. Is there any other function module in sap?

    Thanks Guys, here is my sample code...
    tables:bapimathead,
            bapi_makt,
            bapi_mara,
            bapi_marax,
            bapi_marc,
            BAPI_MARCX.
    data:begin of itab occurs 0,
           MATERIAL type BAPIMATHEAD-MATERIAL,
           IND_SECTOR TYPE BAPIMATHEAD-IND_SECTOR,
           MATL_TYPE type bapimathead-MATL_TYPE,
           PLANT type BAPI_MARC-PLANT,
           MATL_DESC TYPE BAPI_MAKT-MATL_DESC,
           BASE_UOM TYPE bapi_mara-BASE_UOM,
           MATL_GROUP type bapi_mara-MATL_GROUP,
    *      OLD_MAT_NO TYPE BAPI_MARA-OLD_MAT_NO,
    *      DIVISION TYPE BAPI_MARA-DIVISION,
    *      UNIT_OF_WT TYPE BAPI_MARA-UNIT_OF_WT,
    *      NET_WEIGHT TYPE BAPI_MARA-NET_WEIGHT,
    *      DOCUMENT TYPE BAPI_MARA-DOCUMENT,
    *      DOC_TYPE TYPE BAPI_MARA-DOC_TYPE,
           LANGU TYPE BAPI_MAKT-LANGU,
           PUR_GROUP TYPE BAPI_MARC-PUR_GROUP,
           MRP_TYPE TYPE BAPI_MARC-MRP_TYPE,
           MRP_CTRLER TYPE BAPI_MARC-MRP_CTRLER,
           LOTSIZEKEY TYPE BAPI_MARC-LOTSIZEKEY,
           PLND_DELRY TYPE BAPI_MARC-PLND_DELRY,
           SM_KEY TYPE BAPI_MARC-SM_KEY,
           end of itab.
    DATA:    it_RETURN like bapiret2 OCCURS 0 WITH HEADER LINE,
              IT_BAPI LIKE BAPI_MAKT OCCURS 0 WITH HEADER LINE,
              IT_MSG LIKE TLINE OCCURS 0 WITH HEADER LINE.
    parameters:p_file TYPE IBIPPARMS-PATH obligatory.
    at selection-screen on value-request for p_file.
    perform get_f4help.
    start-of-selection.
    perform upload_file_itab.
    perform call_bapi.
    *END-OF-SELECTION.
    *PERFORM ERROR.
    *&      Form  get_f4help
    form get_f4help .
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME        = SYST-CPROG
        DYNPRO_NUMBER       = SYST-DYNNR
      IMPORTING
        FILE_NAME           = P_FILE  .
    endform.                    " get_f4help
    *&      Form  upload_file_itab
    form upload_file_itab .
    DATA:V_FILE TYPE STRING.
    MOVE P_FILE TO V_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
        filename                      = V_FILE
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
       TABLES
         data_tab                      = ITAB .
    endform.                    " upload_file_itab
    *&      Form  call_bapi
    form call_bapi .
    loop at itab.
    BAPIMATHEAD-material = itab-MATERIAL.
    bapimathead-IND_SECTOR = itab-IND_SECTOR.
    BAPIMATHEAD-MATL_TYPE = itab-MATL_TYPE.
    BAPIMATHEAD-BASIC_VIEW = 'X'.
    BAPIMATHEAD-PURCHASE_VIEW = 'X'.
    BAPIMATHEAD-MRP_VIEW = 'X'.
    bapi_mara-MATL_GROUP = itab-MATL_GROUP.
    bapi_mara-base_uom = itab-base_uom.
    *BAPI_MARA-OLD_MAT_NO = ITAB-OLD_MAT_NO.
    bapi_marax-MATL_GROUP = 'X'.
    bapi_marax-BASE_UOM = 'X'.
    *BAPI_MARA-DIVISION = ITAB-DIVISION.
    *BAPI_MARA-UNIT_OF_WT = ITAB-UNIT_OF_WT.
    *BAPI_MARA-NET_WEIGHT = ITAB-NET_WEIGHT.
    *BAPI_MARA-DOCUMENT = ITAB-DOCUMENT.
    *BAPI_MARA-DOC_TYPE = ITAB-DOC_TYPE.
    IT_BAPI-LANGU = ITAB-LANGU.
    IT_BAPI-LANGU_ISO = 'EN'.
    IT_BAPI-MATL_DESC = ITAB-MATL_DESC.
    BAPI_MARC-PLANT = ITAB-PLANT.
    BAPI_MARC-PUR_GROUP = ITAB-PUR_GROUP.
    BAPI_MARC-MRP_TYPE = ITAB-MRP_TYPE.
    BAPI_MARC-MRP_CTRLER = ITAB-MRP_CTRLER.
    BAPI_MARC-LOTSIZEKEY = ITAB-LOTSIZEKEY.
    BAPI_MARC-PLND_DELRY = ITAB-PLND_DELRY.
    BAPI_MARC-SM_KEY = ITAB-SM_KEY.
    BAPI_MARCX-PLANT = 'X'.
    BAPI_MARCX-PUR_GROUP = 'X'.
    BAPI_MARCX-MRP_TYPE = 'X'.
    BAPI_MARCX-MRP_CTRLER = 'X'.
    BAPI_MARCX-LOTSIZEKEY = 'X'.
    BAPI_MARCX-PLND_DELRY = 'X'.
    BAPI_MARCX-SM_KEY = 'X'.
    APPEND IT_BAPI.
    clear it_bapi.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
       EXPORTING
         headdata                  = BAPIMATHEAD
        CLIENTDATA                 = bapi_mara
        CLIENTDATAX                = bapi_marax
        PLANTDATA                  = BAPI_MARC
        PLANTDATAX                = BAPI_MARCX
        IMPORTING
        RETURN                     = it_RETURN
      TABLES
        MATERIALDESCRIPTION        = IT_BAPI .
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'  .
    LOOP AT IT_RETURN.
    CALL FUNCTION 'RPY_MESSAGE_COMPOSE'
       EXPORTING
        LANGUAGE                = SY-LANGU
         MESSAGE_ID              = IT_RETURN-ID
         MESSAGE_NUMBER          = IT_RETURN-NUMBER
      IMPORTING
        MESSAGE_TEXT            = IT_RETURN-MESSAGE
      TABLES
        LONGTEXT                = IT_MSG
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
    *   BIN_FILESIZE                    =
        FILENAME                        = 'D:/DEMO.TXT'
        FILETYPE                        = 'ASC'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    * IMPORTING
    *   FILELENGTH                      =
       TABLES
         DATA_TAB                        = IT_RETURN
    *   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.
    WRITE : /1 IT_RETURN-ID, 10 IT_RETURN-TYPE, 20 IT_RETURN-NUMBER, 25 IT_RETURN-MESSAGE.
    ENDLOOP.
    ENDFORM.
    Text file generated and getting message like 0 bytes transferred.

  • Regarding BAPI Return Parameter.

    Hi All,
              I want to create Bapi Return Message with Variable values like : ' Sales Order 1876738267 is not created, please try again.' and want to create a log of this after BAPI calling in Calling FM. How can I do this. Please guide me.
    Thanks in Advance.

    Hi,
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
      EXPORTING
        ORDER_HEADER_IN           = sd_header
      WITHOUT_COMMIT            = ' '
      CONVERT_PARVW_AUART       = ' '
    IMPORTING
       SALESDOCUMENT             = sd_doc_num
      SOLD_TO_PARTY             =
      SHIP_TO_PARTY             =
      BILLING_PARTY             =
       RETURN                    = return_it
      TABLES
        ORDER_ITEMS_IN            = itemin_it
        ORDER_PARTNERS            = partnr_it
      ORDER_ITEMS_OUT           =
      ORDER_CFGS_REF            =
      ORDER_CFGS_INST           =
      ORDER_CFGS_PART_OF        =
      ORDER_CFGS_VALUE          =
      ORDER_CCARD               =
      ORDER_CFGS_BLOB           =
      ORDER_SCHEDULE_EX         =
    WRITE : / 'sy-subrc = ' , SY-SUBRC.
    IF NOT SD_DOC_Num IS INITIAL.
    WRITE : / 'Sales Order ' , SD_DOC_Num, 'Created'.
    ELSE.
    WRITE : / 'incorrect'.
    WRITE : / RETURN_it-TYPE , RETURN_it-MESSAGE.
    WRITE : / RETURN_it-LOG_NO, RETURN_it-LOG_MSG_NO,
              RETURN_it-MESSAGE_V1.
    ENDIF.
    Hope this helps you.
    Thanks,
    Ruthra

  • Return Messages for a BAPI run in Background

    Hi all,
    I am running a BAPI( BAPI_SALESORDER_CHANGE ) in Background task, It works fine and updates the Sales order but i dont get any return messages.But based on the return messages i need to show up on the report which orders got updated and which are not.....
    Can anyone help me how can i get the return messages when i run a BAPI in background task......

    Thanks for the quick response....I think you got me wrong...I am not running the program as a background job....I am running only the bapi in background task as below.....
                CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
                   IN BACKGROUND TASK AS SEPARATE UNIT
                     EXPORTING
                          salesdocument    = v_vbeln
                          order_header_in  = it_bapisdh1
                          order_header_inx = it_bapisdh1x
                     TABLES
                          return           = it_return
                          partnerchanges   = it_bapiparnrc.
    When the bapi runs as a background task i dont get any return messages in it_return but the sales order gets updated....
    But i will have to capture the return messages as well....How can i achieve that ?

  • BDC return message table problem

    Dear All
    We are doing BDCs for Excise Invoice (J1IS) and for Posting Excise
    Invoice (J1IV) in Backgroung mode.
    Here we are facing problem in BDC return message table (messtab) which
    retruns the internal document number,errors or warning messages
    in BDC rerurn message table.when we are doing BDC for J1IS in background
    mode, no internal document number or error messages is generated in
    BDC message table (ie in messtab), but the excise invoice is posted and database table
    j_1iexchdr is updated with internal document number even though Accessible
    value is '0'.Then we are taking this internal document nuber from databae
    table j_1iexchdr passing to next BDC for J1Iv.Again after execution of BDC for J1IV
    in background mode the same is happening as J1IS BDC return message table.
    Is it the correct method of data retrieving from Database table ?
    and we want to capture all types of error messages and internal document
    no generated by BDC message table.How to capture BDC return messages.
    Does Transactions J1Is and J1IV are executable for BDC ?
    Thanks and Regards,
    Ulhas

    Hi
    Use the following code to capture the return table values.
    data: i_msg type standard table of bdcmsgcoll with header line.
    LOOP AT I_MSG.
        CALL FUNCTION 'FORMAT_MESSAGE'
         EXPORTING
           ID              = I_MSG-MSGID
           LANG            = SY-LANGU
           NO              = I_MSG-MSGNR
           V1              = I_MSG-MSGV1
           V2              = I_MSG-MSGV2
           V3              = I_MSG-MSGV3
           V4              = I_MSG-MSGV4
         IMPORTING
           MSG             = W_STR
    *  EXCEPTIONS
    *    NOT_FOUND       = 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.
        WRITE:/ i_msg-msgnr,w_str.
      endloop.
    Regards,
    Vishwa.

  • BAPI_Create_Bank, problems with returning message

    HI getleman's!! I`m new in SAP (ABAP).
    I`m using BAPI_Create_Bank and I realize that, when the data is commited rightly the message doesn't return anything.
    althought when I'm trying to insert some replicate data the message of the Bapi return me and "E" Error.
    I'm not sure if the message only return when it happened an error.
    the options of the data element BAPIRET2 (message) shows:
    Field: type 
    Description:
    - Message type: S Success, E Error, W Warning, I Info, A Abort.
    The 'S' has never been returned.
    Thanks for your help.
    regards.
    Polak.-

    Hi Hernan Szmajser ,
                                       The return table parameter data population is based on the code inside the BAPI. for this BAPI the Return parameter is getting populated only for the error situation . If you look into the function module / BAPI they are calling  a  form routine "bank_distribute" in include L1011F01
    Inside this include they are populating the return table only if the SY-SUBRC NE 0.
    Check this piece of code inside the form routine:
    Distribution of Bank*
      CALL FUNCTION 'ALE_BANK_SAVEREPLICA'
           EXPORTING
                bankctry                = bankcountry
                bankkey                 = bankkey
                bankaddress             = bank_address
                bankdetail              = bank_detail
            SERIAL_ID               = '0'*
           TABLES
                receivers               = receivers
            COMMUNICATION_DOCUMENTS =*
            APPLICATION_OBJECTS     =*
           EXCEPTIONS
                error_creating_idocs    = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
        PERFORM set_return_message USING sy-msgty sy-msgid sy-msgno
                                         sy-msgv1 sy-msgv2
                                         sy-msgv3  sy-msgv4
                                CHANGING return.
      ENDIF.
    Hope it helps.
    Thanks,
    Greetson

  • Is there any BAPI returning the affected organisational units to users?

    Dear all,
    I would like to ask a question about organizational units. Whenever I want to affect a user to a given unit I
    use PPOME transaction. If I want to do this in ABAP level I use the function module RH_RELATION_WRITE.
    I would like to know, is there any BAPI returning the affected organizational unit to a given user?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    Alberto Sesma wrote:
    You can use Function Module RH_STRUC_GET
    >
    >
    > CALL FUNCTION 'RH_STRUC_GET'
    >   EXPORTING
    >      ACT_OTYPE = 'US'
    >      ACT_OBJID = user_name
    >      ACT_WEGID = 'US_CP_O'
    >   TABLES
    >        RESULT_TAB = LT_RESULT_TAB.
    >
    >
    > You will get the related org units in LT_RESULT_TAB. There are other two table parameters in that function module that you may find useful.
    >
    > If the function does not return any valid data you may try with other values for WEGID. You will find all the possible evaluation paths in transaction OOAW.
    >
    > Kind regards
    Dear Alberto,
    Thank you very much for your answer. I didn't know this FM and it solved my problem.
    For those who may be intered here is exactly I proceed. Suppose that in the table HRP1000 you have an
    structure (type S) with ObjID = 50000342 and you wish to have the SapUserID of the affected persons.
    DATA:
          affected_users TYPE STANDARD TABLE OF swhactor,
          user LIKE LINE OF affected_users.
    START-OF-SELECTION.
      CALL FUNCTION 'RH_STRUC_GET'
        EXPORTING
          act_otype              = 'S'
          act_objid              = '50000342'
          act_wegid              = 'A008'
          act_plvar              = '01'
          act_begda              = sy-datum
          act_endda              = sy-datum
          act_tdepth             = 0
       TABLES
         result_tab             = affected_users
    EXCEPTIONS
       NO_PLVAR_FOUND         = 1
       NO_ENTRY_FOUND         = 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.
      LOOP AT affected_users INTO user.
        WRITE: / user-objid.
      ENDLOOP.
    Also in transaction OOAW we can have all possible values for the third argument of the module function (act_wegid).
    For those who are interested, here are a few among many possible values which seem to be intesting for my
    problem.
    DFPS_DG1----
    Organizational Unit of User
    DFPS_DG3----
    All Org. Units Above a User
    ORGAS----
    Closest Organizational Unit and structure
    ORGASS----
    Closest Organizational Unit and structure     
    PPLEORG     -
    Organizational unit of an employee or position
    SAP_ORGP----
    Organizational assignments of a user/person
    SAP_USOG----
    Organizational Assignments of a User
    SAP_US_S----
    Positions and Personnel Number of a User
    US_S_S_C----
    All positions and jobs of a user
    WFM_ORGU----
    Organizational Assignment of User
    WF_ORGUN----
    Organizational unit of a user/person (module id Ben./Pers.)
    For example, let's say we have a userid named MYUSER01 and we would like to find all structures to which the user
    is affected. Here is how I proceed.
    DATA:
          itab_user_structures TYPE STANDARD TABLE OF swhactor,
          row_user_structures LIKE LINE OF itab_user_structures.
    START-OF-SELECTION.
    CALL FUNCTION 'RH_STRUC_GET'
        EXPORTING
          act_otype              = 'US'
          act_objid              = 'MYUSER01'
          act_wegid              = 'US_S_S_C'
          act_plvar              = '01'
          act_begda              = sy-datum
          act_endda              = sy-datum
          act_tdepth             = 0
       TABLES
         result_tab             = itab_user_structures
    EXCEPTIONS
       NO_PLVAR_FOUND         = 1
       NO_ENTRY_FOUND         = 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.
      LOOP AT itab_user_structures INTO row_user_structures.
        WRITE: / row_user_structures-objid.
      ENDLOOP.
    Thank you very much for your help.
    Kind Regards,
    Dariyoosh

  • Return message isse while using "API_RE_CN_CHANGE"

    Hi Experts
    I have an issue in capturing return messages while using API_RE_CN_CHANGE to alter a real estate contract.follows is the problem description -
    API_RE_CN_CHANGE is called to change a realestate contract(insert a condition) with key to identify the contract as "Object instance of the contract". In this case, the return message form the API is empty. this is how i use the API function module -
    CALL METHOD cf_recn_contract=>find
        EXPORTING
          id_bukrs         = bukrs
          id_recnnr        = recnnr
          id_activity       = reca1_activity-change    " Change mode
          if_auth_check = abap_false
          if_enqueue    = abap_true                " LOck the contract
        RECEIVING
          ro_instance   = lo_contract              " getting the contract object instance
        EXCEPTIONS
          error               = 1
          OTHERS        = 2.
        CALL FUNCTION 'API_RE_CN_CHANGE'
          EXPORTING
           id_bukrs                  = g_t_contracts-bukrs      " Not using this field
          id_recnnr                 = g_t_contracts-recnnr      " Not using this field
            io_object                 = lo_contract
            it_term_sr_sales          = lt_term_sr_sl_intc
            it_condition              = lt_condition_intc
            if_test_run               = g_testrun_flg
            if_msglist_instead_of_exc = 'X'
            io_msglist                = lo_msglist_t    " Error messages list
         IMPORTING
           EF_STORED                       = ef_stored
         EXCEPTIONS
           ERROR                           = 1
           OTHERS                          = 2
    convert messages to bapi return list
        CALL METHOD lo_msglist_t->get_list_as_bapiret
          IMPORTING
            et_list = g_t_return[].  " Read the messages in internal table
    Here the method does not give the return message as import parameter. but all these stuff works if i call API_RE_CN_CHANGE using company code(BUKRS) & Contract number(RECNNR).
    Can anybody suggest a solution.
    Thanks
    Mukundhan

    Hello Mukundhan
    While function module API_RE_CN_CHANGE may work this is not the way how I would change a contract condition. Since you are obviously working with RE-FX and dealing with a contract instance (IF_RECN_CONTRACT) I would apply the following logic:
    DATA:
      lo_contract              TYPE REF TO if_recn_contract,
      lo_condition_Mngr    TYPE REF TO if_recd_condition_manager,
      lo_condition             TYPE REF TO if_recd_condition.
    " Create contract instance
      CALL METHOD cf_recn_contract=>find
        EXPORTING
        RECEIVING
          ro_instance = lo_contract
       EXCEPTIONS
         others = 1.
    " Get condition manager from contract
      lo_condition_mngr =
            lo_contract->IF_RECD_HAS_CONDITION~GET_CONDITION_MNGR( ).
    " Insert a new condition
       CALL METHOD lo_condition_mngr->insert_condition
         EXPORTING
        RECEIVING
          ro_condition = lo_condition.
    Regards
      Uwe

  • Return messages in SyncBo

    Hi
    I have made a mobile application with smartsync, SyncBo type U01. I would like to show the error messages (that I can se when I test the BAPI wrapper) in the mobile application. I can't se any info about the RETURN type BAPIRET2 when I am mapping the datatypes in the SyncBO.
    Is there a way to do this?
    Best Regards
    Morten

    hello morten,
    the messagereply is returned by the MW when it is unable
    to process the message e.g. some technical problems.
    if the middleware processed the messages and the BAPI
    returned an error, it will be in the form of a SyncReply
    which are notified if your applicaion implemented and
    registered a SyncReplyObserver. Both MesageReply and
    SyncReply has a getText() method which will give you
    the description text.
    Please refer to the SyncReply, SyncReplyObserver, and
    InboxNotifier interface in the javadoc.
    Regards
    jg

  • Error in BAPI RETURN for Service Contract

    Hi,
      I get an error in the BAPI Return for the Uploading the Service Contracts by LSMW. The Error Message is E BS No status object is available for &.Also want to know can we upload multiple line of header text for a Contract by this BAPI. If so then how would I do this , as the BAPI structure BAPISDTEXT has textline upto 132 characters. And I am take only one file in LSMW where the header & details come alongwith text. Or could also tell me the file structure of for the data upload. The legacy system sends multiple text in the header for a Contract.For Eg.
    Header1 Detail1 Text1
    HEader1 Detail2 Text2
    Header1 Detail3 Text3
    So I would need this text1TEXT2text3 in the Header Text of the Contracts. Or do I need the change the file structure. Many thanks for your time and help.

    Thanks Nablan, I could do that for multiple header coming in file. But I have a question for you on BAdI ALM_ME_006_GOODSMVT. I have implemented this BAdI , and this BAdI is called by a function Module ALM_MEREP_006_CREATE. When I test this FM giving the Material , Orderid and Movement type entries, this BAdI is triggered when giving a breakpoint. I've given this code for changing the movement type to 961. Cause the stanadrd scenario does not maintain Movement type 961 in Mobile Asset Management. The Movement type 961 for unplanned Materials comes to SAP and changes to 261 as maiantained by TCOKO table. To bypass this & retain the movement type 961 in SAP I'm using this BAdI. Currently this is what I'm doing and am stuck in the method interface how do I call the method.
    method IF_EX_ALM_ME_006_GOODSMVT~CREATE .
    break-point.
    *DATA : i_ce_goodsmovement TYPE REFERENCE
              ALM_ME_CUSTOMER_ENHANCEMENT.
    DATA : lr_badi_goods_movement TYPE REF TO if_ex_alm_me_006_goodsmvt.
    DATA : ls_user_data TYPE ALM_ME_USER_DATA-USERID.
    *DATA : goods_movement TYPE ALM_ME_MATERIAL_MOVEMENT.
    CALL METHOD lr_badi_goods_movement->create
      EXPORTING
           ce_goodsmovement = ce_goodsmovement
      IMPORTING
           user_data        = ls_user_data
           custom_user_data = ls_ce_user_data
           goods_movement   = goods_movement
      changing
           return           = return[].
    CALL FUNCTION 'ALM_ME_COMMIT_OR_ROLLBACK'
           TABLES
                return = return.
    endmethod.
    Please help me to get the data in this method. How do I call this.

Maybe you are looking for

  • Regarding the Delivery schedule item in Production order

    Hi Gurus, Kindly can you let me know what are the settings to be done for getting the delivery schedule line number in the production order along with the sales order and item number for a MTO scenario. Regards Anand

  • Premiere Elements 11 won't open

    Installed Premiere Elements 11 but it won't open. Have uninstalled and reinstalled but still no luck.

  • Xml file icon not showing

    Hi, I recently installed Dreamweaver CS4 on my Vista Business 32bit. By default xml files are associated to open with Dreamweaver, however the icon that is being displayed for the xml files is a blank paper icon. All the other files like .css, .js et

  • Files wont convert with sidecar information

    Hello, I have been trying to convert camera raw files to jpgs with updated color correction, exposure, etc working from Bridge to CS3 using batch processing. The application runs the script with sharpening but will not apply the updated camera raw in

  • Texting Issue

    First of all, I'm sorry if this is not in the correct category. I wasn't sure where it belonged. I'm having a small issue with texting on my Palm Treo 750. When i try to reply to a text, i get a message that reads "Error Invalid Number. Please resend