Skip to Content
avatar image
Former Member

ERROR:"Invalid or no mapping to system data types found" in Gateway Client

Hello experts:

         I want to use http method 'post' to upload file to internal table,and after I redefine 'create_stream' in my DPC and test it in Client,It shows "Invalid or no mapping to system data types found".



this is my MPC:


lo_entity_type = model->create_entity_type('File').

lo_entity_type->set_is_media( 'X' ).

lo_property = lo_entity_type->create_property( iv_property_name  ='Mandt    iv_abap_fieldname = 'MANDT').

lo_property = lo_entity_type->create_property( iv_property_name  ='Filename'  iv_abap_fieldname = 'FILENAME').

lo_property->set_is_key( ).

lo_property = lo_entity_type->create_property( iv_property_name  ='Sydate' iv_abap_fieldname = 'SYDATE').

lo_property = lo_entity_type->create_property( iv_property_name  ='Sytime' iv_abap_fieldname = 'SYTIME').

lo_property = lo_entity_type->create_property( iv_property_name  ='Value'  iv_abap_fieldname = 'VALUE').

lo_property = lo_entity_type->create_property( iv_property_name  ='Mimetype' iv_abap_fieldname = 'MIMETYPE').

lo_entity_type->bind_structure( 'Z_CL_MODEL_PROVIDER=>FILE' ).

lo_entity_type->create_entity_set( 'FILESET' ).


this is my DPC:

method/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_STREAM.

DATA ls_excel                     TYPE ZEXCELDETAIL.

         ls_excel-mimetype = is_media_resource-mime_type.

         ls_excel-filename = iv_slug.

         ls_excel-value = is_media_resource-value.

         copy_data_to_ref( EXPORTING is_data = ls_excel

                           CHANGING  cr_data = er_entity ).



Is anyone knows how to fix with it?

Thanks!!!!!!!



Regards,

Cao

no-slug.JPG (210.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 23, 2014 at 06:20 AM

    Hi Zhiyu,

    To trigger CREARE_STREAM, the URL should be like:

    /sap/opu/odata/sap/ZTEMP_SRV/ET_USERSSet('TEST_USER')/ET_PHOTOSSet

    Where ET_PHOTOSSet is the navigation property name. The ET_USERSSet is the principal entity.

    SLUG is nothing but the filename that you would like to pass it your backend system if needed.

    Regards,

    Aashika Agarwal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 23, 2014 at 08:17 AM

    Hello Cao,

    Please first clear your model cache in your GW System and check again.

    /iwfnd/cache_cleanup.

    Please refer this as well and make the necessary chages in MPC_EXT class inside the Define Mehod.->

    Regards,

    Ashwin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Cao,

      After you add code in MPC_EXT class of Define method,

      I see that your URL is wrong now.

      You are using GET method instead of POST.

      You have not attached any attachment to fire the Create Stream method.

      You are not specifying the entity set name in the URL.

      You are not passing Key in slug parameter.

      So its expected that you are bound to get errors.

      Pleas check the highlighted as below :

      Please check the above points.

      Regards,

      Ashwin

      Model.JPG (239.7 kB)
  • Jan 12, 2015 at 07:07 AM

    Hi Zhiyu,

    Please Cross verify the Ashwin Last reply and verify one more time MPC_EXT code you placed it correctly or not..max this error will come based on MPC coded bounded .

    Let me know if you need more info on this.

    Thanks,

    Syam

    Add comment
    10|10000 characters needed characters exceeded