cancel
Showing results for 
Search instead for 
Did you mean: 

Publish RFQ from custom behavior class save method

AnandLanka
Discoverer
0 Kudos
96

Dear Experts,

I have a requirement to develop custom application in HANA Public Cloud where user selects specific supplier to approve then it should automatically publish RFQ. Lo_http_client being generated but session getting terminated at lo_http_client->execute method and not catching at exceptions. Request your valuable inputs to take it forward. below is the sample code for your reference written in Behavior save/create method. Thank you
 
lo_url = 'https://{hostname}/sap/opu/odata/sap/API_RFQ_PROCESS_SRV/SubmitForApproval?RequestForQuotation='7000000010''

lo_http_client = cl_web_http_client_manager=>create_by_http_destination(

i_destination = cl_http_destination_provider=>create_by_url( lo_url ) ).
Try

DATA(lo_response) = lo_http_client->execute(

i_method = if_web_http_client=>post ).

CATCH cx_web_message_error cx_web_http_client_error cx_http_dest_provider_error. "#EC NO_HANDLER

" data(lv_msg) = lo_Response->get_text( ).

ENDTRY.

 

View Entire Topic
AnandLanka
Discoverer
0 Kudos

Hello All,

Request you to close this thread i got the solution. we need to pass cookies along with csrf token will help resolve the issue and make successful API call.

Regards,