Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Program error: Object type of receiver cannot be determined

Former Member
0 Likes
3,000

Hello Experts,

               Am getting this error "Program error: Object type of receiver cannot be determined" when creating internal orders using BAPI_INTERNALORDERS_CREATE. I read many forums, but they are not answered. I didn't get any solution. Any Solution Please.

Thanks in Advance

6 REPLIES 6
Read only

former_member202818
Active Contributor
0 Likes
1,903

Hi,

can you provide the code.

Or you run your program in debug mode using /hs.

press F9 to put break-points at all RAISE and MESSAGE statement.

Press F8 find out from where the error is coming and why it is coming.

Read only

0 Likes
1,903

Here is my Code

TYPE-POOLS : TRUXS.

TYPES:BEGIN OF TY_COAS_SVALD,

      AUART TYPE AUFART,         "Order Type

      BUKRS TYPE BUKRS,          "Company Code

      KTEXT TYPE AUFTEXT,        "Description

      GSBER TYPE GSBER,          "Business Area

      WERKS TYPE WERKS_D,        "plant

      KDAUF TYPE KDAUF,          "Sales Order Number

      KDPOS TYPE KDPOS,          "Item

      USER0 TYPE AUFUSER0,       "Applicant

      USER1 TYPE AUFUSER1,       "Applicant's telephone number

      USER2 TYPE AUFUSER2,       "Person responsible

      USER6 TYPE AUFUSER6,       "Department

      KOKRS TYPE KOKRS,          "Controlling area

      AUFWAERS TYPE AUFWAERS,    "Currency

      END   OF TY_COAS_SVALD .

DATA : IT_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.

DATA:T_COAS TYPE STANDARD TABLE OF TY_COAS_SVALD INITIAL SIZE 0,

    WA_COAS TYPE  TY_COAS_SVALD.

PARAMETERs : p_file TYPE IBIPPARMS-PATH.

at SELECTION-SCREEN on VALUE-REQUEST FOR p_file.

  PERFORM browse_file.

INITIALIZATION.

  CLEAR:WA_COAS.

  REFRESH:T_COAS.

START-OF-SELECTION.

PERFORM LOAD_FLAT_FILE.

PERFORM SUB_CALL_BAPI_FOR_KO01.

FORM browse_file .

CALL FUNCTION 'F4_FILENAME'

IMPORTING

   FILE_NAME           = p_file

          .

ENDFORM.                    " browse_file

FORM LOAD_FLAT_FILE .

DATA : LT_RAW TYPE TRUXS_T_TEXT_DATA.

  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

    EXPORTING

      I_FIELD_SEPERATOR          = 'X'

     I_LINE_HEADER              = 'X'

      I_TAB_RAW_DATA             = LT_RAW

      I_FILENAME                 = P_FILE

    TABLES

      I_TAB_CONVERTED_DATA       = T_COAS

   EXCEPTIONS

     CONVERSION_FAILED          = 1

     OTHERS                     = 2

            .

  IF SY-SUBRC <> 0.

  ENDIF.

ENDFORM.                    " LOAD_FLAT_FILE

FORM SUB_CALL_BAPI_FOR_KO01 .

  DATA:L_MASTERDATA  TYPE BAPI2075_7,

       LE_MASTERDATA TYPE BAPI2075_2,

       T_BAPI TYPE STANDARD TABLE OF BAPI2075_6 INITIAL SIZE 0,

       WA_BAPI TYPE BAPI2075_6.

clear:l_masterdata,

      le_masterdata,

      wa_bapi.

refresh:t_bapi.

  LOOP AT T_COAS INTO WA_COAS.

  L_MASTERDATA-ORDER_TYPE = WA_COAS-AUART.

  L_MASTERDATA-COMP_CODE = WA_COAS-BUKRS.

  L_MASTERDATA-ORDER_NAME = WA_COAS-KTEXT.

  L_MASTERDATA-PLANT = WA_COAS-WERKS.

  L_MASTERDATA-BUS_AREA = WA_COAS-GSBER.

  L_MASTERDATA-SALES_ORD = WA_COAS-KDAUF.

  L_MASTERDATA-S_ORD_ITEM = WA_COAS-KDPOS.

  L_MASTERDATA-APPLICANT = WA_COAS-USER0.

  L_MASTERDATA-APPLICANT_PHONE = WA_COAS-USER1.

  L_MASTERDATA-PERSON_RESP = WA_COAS-USER2.

  L_MASTERDATA-DEPARTMENT = WA_COAS-USER6.

  L_MASTERDATA-CO_AREA = WA_COAS-KOKRS.

  L_MASTERDATA-CURRENCY = WA_COAS-AUFWAERS.

  WA_BAPI-SALES_ORD = WA_COAS-KDAUF.

  WA_BAPI-S_ORD_ITEM = WA_COAS-KDPOS.

  WA_BAPI-COMP_CODE = WA_COAS-BUKRS.

  APPEND WA_BAPI TO T_BAPI.

CALL FUNCTION 'BAPI_INTERNALORDER_CREATE'

      EXPORTING

        I_MASTER_DATA       = L_MASTERDATA

IMPORTING

   E_MASTER_DATA       = LE_MASTERDATA

TABLES

   SRULES              = T_BAPI

   RETURN              = IT_RETURN

              .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

  ENDLOOP.

  WRITE : / IT_RETURN-TYPE, IT_RETURN-MESSAGE.

ENDFORM.                    " SUB_CALL_BAPI_FOR_KO01

Read only

0 Likes
1,903

The message was triggered during rule determination (in FM K_DEFAULT_RULE_READ)

Move the WRITE of returned messages in the loop, and replace the commit work with a rollback work in case of error message, also RETURN is an internal table, so loop at it looking for error or during log writing.

Also try to create an internal order with those values with transaction KO01, and check Customizing of your internal order type(s) with transaction KOT2_OPA.

Regards,

Raymond

Read only

Former Member
0 Likes
1,903

Thanks Raymond Giuseppi, i tried whatever you said. Sreekanth u got some idea? am Still struggling.

Read only

0 Likes
1,903

I have copied your code and created a report program.Please send me uploading XL file format, with dummy data for testing purpose.

Read only

0 Likes
1,903
01001000Sample 100010001127210SAMPLE9096945667SAMPLES444595641000EUR