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

HTTP Multi-Form Post - And Config?

Former Member
0 Likes
1,481

Hey Everyone,

I'm stuck on a situation where my code in PRD does not behave like my code in DEV and QAS. This code is a simple multi-part HTTP post to an external system. Nothing special. There are two variables in my equation:

1. DEV and QAS are on a higher kernel level than PRD. The kernel has not migrated that far yet.
2. I have the cryptographic library active on DEV and QAS, but not on PRD. Like the kernel, it has not migrated there yet.

Mind you, I've double checked the SICF and SMICM settings to guarantee they are identical in all systems. Is there something else that I have missed?

I have seen situations before where kernel applications have "tightened the bolts" on weak code, so I thought perhaps my code was "weak." Would someone mind giving a glance over to see if something is missing? Note that it works great in PRD, but not in QAS and DEV. It could be just sloppy code that crumbled under the stringent eye of a new kernel.

Here is the code...thanks for your attention.

Greg

DATA:  http_client       TYPE REF TO if_http_client.

    CALL METHOD cl_http_client=>create

      EXPORTING

        host    = lv_host

        service = '80'

        scheme  = '1'

      IMPORTING

        client  = http_client.

*These steps fill the HTTP Post basic settings for communication back to the URL that first Posted to SAP.

    http_client->request->set_header_field( name = '~request_uri'     value = sourcetask_http_url ).

    http_client->request->set_header_field( name = '~request_method'  value = 'POST' ).

    http_client->request->set_header_field( name = 'Content_Type'     value = 'multipart/form-data' ).

    http_client->request->set_header_field( name = '~server_protocol' value = 'HTTP/1.1' ).

* Variable Fields Need to Map to EDMS Form *These steps fill the MIME multi-part form fields with values.

    http_client->request->set_form_field( name = 'taskstatus' value = 'Done').

    http_client->request->set_form_field( name = 'attributes_ref_canddoc_1' value = attributes_ref_canddoc_1 ).

    http_client->request->set_form_field( name = 'wf_status' value = wf_status ).

    http_client->request->set_form_field( name = 'forms_dlm_lbl_form_change_type_1' value = form_change_type_1 ).

    http_client->request->set_form_field( name = 'forms_dlm_lbl_form_change_ref_1' value = form_change_ref_1 ).

    http_client->request->set_form_field( name = 'forms_dlm_lbl_form_dp_repart_1' value = form_dp_repart_1 ).

  *This step sends the HTTP Post to the external system.

    http_client->send( ).

*This step is necessary to make sure the communication was a success. Without it a failure won't be known.

    CALL METHOD http_client->receive

      EXCEPTIONS

        http_communication_failure = 1

        http_invalid_state         = 2

        http_processing_failed     = 3

        OTHERS                     = 4.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,099

Update: I've reviewed the system profile, the ICF, the Crypto Library, the RFC, the ICM, rewritten my code in numerous ways, reverted the kernel back to its original level...all to no avail. What did come of it is this...and a lesson I've learned many times and should have been more astute and critical from the start. When the downstream system you are communicating with tells you they have not made a change and it must be SAP...well, make sure they are not lying. "Well, the change we made wouldn't affect that." Oh...really.

1 REPLY 1
Read only

Former Member
0 Likes
1,100

Update: I've reviewed the system profile, the ICF, the Crypto Library, the RFC, the ICM, rewritten my code in numerous ways, reverted the kernel back to its original level...all to no avail. What did come of it is this...and a lesson I've learned many times and should have been more astute and critical from the start. When the downstream system you are communicating with tells you they have not made a change and it must be SAP...well, make sure they are not lying. "Well, the change we made wouldn't affect that." Oh...really.