Skip to Content
Former Member
Jun 09, 2014 at 02:33 PM

HTTP Multi-Form Post - And Config?


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.


DATA: http_client TYPE REF TO if_http_client.

CALL METHOD cl_http_client=>create


host = lv_host

service = '80'

scheme = '1'


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


http_communication_failure = 1

http_invalid_state = 2

http_processing_failed = 3