cancel
Showing results for 
Search instead for 
Did you mean: 

custom design of EZFORM to create Shopping Cart

Former Member
0 Kudos

Hello,

I am trying to send the data across the SRM 7 from ECC system. Currently we have "Describe Requirment" given by SAP that is used to create a shopping cart. In Describe Requirment Form there are 4 steps to Shop. The controller sequence is Select (1)Goods/Service, (2) Shopping Cart, (3) Complete and Order (4) Confirmation. So, when you click "ok" button on Describe Requirment form it leaves the current form, triggers the "On_Add_To_Shopping_Cart" Action and takes the controller to the next level (i.e From Select Goods/Service to Shopping Cart). However, we want to create a completely new form with our own design in Web Dynpro that would have additional fields with some logics. In this new form, I am able to capture the value within the ECC system through the Portal. However, I am not able to pass the values to the Shopping Cart. Following is the code I've written in Web Dynpro on Submit action. Shall appreciate if anyone can let me know how to proceed, inorder to pass these values to the Shopping Cart. Currently, I am using hardcoded values for testing purpose.

-


DATA lo_el_context TYPE REF TO if_wd_context_element.

DATA ls_context TYPE wd_this->Element_context.

DATA lv_value1 TYPE wd_this->Element_context-value1.

DATA url TYPE STRING.

DATA uri TYPE STRING.

data hook_url type string.

DATA httpClient TYPE REF TO IF_HTTP_CLIENT.

  • url = 'http://j603a000.esc.win.colpal.com:8000'.

  • uri = '/sap/sapsrm/inbound_hdlr?TARGET_URL=http%3a%2f%2fepdev-jf00%2eesc%2ewin%2ecolpal%2ecom%3a50000%2firj%2fportal%3fNavigationTarget%3dpcd%3aportal_content%2fcom%2esap%2epct%2fspecialist%2fcom%2esap%2epct%2esrm%2esrm70%2'.

-


lo_el_context = wd_context->get_element( ).

call method cl_http_client=>CREATE_BY_URL

exporting

url = url

importing

client = httpClient.

  • APPEND_FIELD_URL

  • httpClient->APPEND_FIELD_URL ( name = 'TARGET'

  • value = uri

  • url).

httpClient->response->SET_HEADER_FIELD( name = '~request_method' value = 'POST' ).

httpClient->response->set_form_field( name = 'NEW_ITEM-DESCRIPTION[1]' value = 'FROM EZFORM' ).

httpClient->response->set_form_field( name = 'NEW_ITEM-PRICE[1]' value = '10' ).

httpClient->response->set_form_field( name = 'NEW_ITEM-CURRENCY[1]' value = 'USD' ).

httpClient->response->set_form_field( name = 'NEW_ITEM-UNIT[1]' value = 'EA' ).

httpClient->response->set_form_field( name = 'NEW_ITEM-CUST_FIELD1[1]' value = 'Custom Field1' ).

httpClient->response->set_form_field( name = 'NEW_ITEM-MATGROUP[1]' value = 'I0400001' ).

httpClient->response->set_form_field( name = 'NEW_ITEM-QUANTITY[1]' value = '100' ).

httpClient->send( ).

-


Thks & Rgds,

Hemal

Edited by: Hemal Gandhi on Jan 22, 2010 3:48 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

No answers were provided so closing this one.