cancel
Showing results for 
Search instead for 
Did you mean: 

How to map the appointment date in CRMXIF_ORDER_SAVE_M02-4x ?

former_member198180
Active Participant
0 Kudos

Hi Team,

I want to map the field in CRMXIF_ORDER_SAVE_M02-4X, how to map..please help ..where we need to do ..could you please tell me the steps.

 

CustomerAppointmentDate  

CRMXIF__ORDER__SAVE__M02-4x/ E101CRMXIF__BUSTRANS/ E101CRMXIF__APPOINTMENT__XT/E101CRMXIF__APPOINTMENT/ TIMESTAMP__FROM

Thanks

Kalpana  

Accepted Solutions (1)

Accepted Solutions (1)

abibenbella
Explorer
0 Kudos

Hi Kalpana,

Below is a sample code. Modify this as per your input.

* Header details

  CLEAR itab_edidc40. 

MOVE sy-mandt TO itab_edidc40-mandt .

MOVE sy-saprl TO itab_edidc40-docrel. 

itab_edidc40-docnum = '0000000000000001'.

itab_edidc40-direct = '2' . 

CONCATENATE 'SAP' sy-sysid INTO itab_edidc40-rcvpor. 

itab_edidc40-rcvprt = 'LS'. 

itab_edidc40-rcvprn = t000-logsys. 

CONCATENATE 'SAP' sy-sysid INTO itab_edidc40-sndpor. 

itab_edidc40-sndprt = 'LS'. 

itab_edidc40-sndprn = t000-logsys. 

itab_edidc40-mestyp = 'CRMXIF_ORDER_SAVE_M' . 

itab_edidc40-idoctyp = 'CRMXIF_ORDER_SAVE_U02' . 

itab_edidc40-arckey = ' '.

itab_edidc40serial = l_serial . 

APPEND itab_edidc40  .  CLEAR itab_edidc40  .

  CLEAR: itab_edidd40 ,e101crmxif_bustrans. 

itab_edidd40-segnam = 'E101CRMXIF_BUSTRANS'. 

itab_edidd40-docnum = '0000000000000001'.

e101crmxif_bustrans-object_task = ’I’.

e101crmxif_bustrans-object_type = eg: 'BUS2000117'.

e101crmxif_bustrans-process_type = process type of your transaction.

e101crmxif_bustrans-description = ’Test’.

MOVE e101crmxif_bustrans TO itab_edidd40sdata . 

APPEND itab_edidd40  .  CLEAR itab_edidd40  .

itab_edidd40-segnam = 'E101CRMXIF_APPOINTMENT_XT'.

itab_edidd40-docnum = '0000000000000001'.

e101crmxif_partner_xtdatax =  'X' . 

MOVE  e101crmxif_partner_xt TO itab_edidd40-sdata . 

APPEND itab_edidd40  . 

CLEAR: itab_edidd40,e101crmxif_bustrans  .

*** Pass the Value   

itab_edidd40-segnam = 'E101CRMXIF_APPOINTMENT'.   

itab_edidd40-docnum = '0000000000000001'.

e101crmxif_appointmenttimestamp_from = ‘01/03/2015’.   

MOVE e101crmxif_appointment TO itab_edidd40sdata .   

APPEND itab_edidd40  .    CLEAR itab_edidd40  .


* Create IDoc

CALL FUNCTION 'IDOC_INBOUND_ASYNCHRONOUS'   

TABLES    

idoc_control_rec_40 = itab_edidc40     

idoc_data_rec_40    = itab_edidd40.


SELECT  * FROM edidc   WHERE serial = l_serial .  

l_range-low = edidc-docnum.    l_range-sign = 'I'.    l_range-option = 'EQ'.    APPEND l_range.  ENDSELECT .


* report program to create transaction 

SUBMIT rbdapp01 WITH docnum IN l_range                WITH p_output = ' '  AND RETURN.  COMMIT WORK.

WAIT UP TO 2 SECONDS. 

SELECT  status countr statyp stapa4     INTO (l_status, l_countr, l_statyp,l_stapa4)    UP TO 1 ROWS     FROM  edids     WHERE docnum = edidc-docnum      ORDER BY countr DESCENDING . 

ENDSELECT. 

SELECT SINGLE object_id guid INTO (lv_object_id , lv_object_guid)     FROM crmd_orderadm_h     WHERE guid = l_stapa4+0(32).

IF lv_object_id IS NOT INITIAL.  

object_id = lv_object_id.

ENDIF. 

COMMIT WORK.


You can test it using WE02 or WE05 transaction.


Give Points if useful.


Regards,

Abi

former_member198180
Active Participant
0 Kudos

Hi Abi,

Thanks for your reply..where we need to implement this logic..i have one custom badi-

 

ZCRMXIF_ORDER_MAP

Method - CHANGE_MAPPED_DATA_OUT

How to map the fields, and i have few more fields ..So please help here..how to implement here.

 

CustomerAppointmentDate  

 CRMXIF__ORDER__SAVE__M02-4x/ E101CRMXIF__BUSTRANS/ E101CRMXIF__APPOINTMENT__XT/E101CRMXIF__APPOINTMENT/ TIMESTAMP__FROM  

Thanks

kalpana

abibenbella
Explorer
0 Kudos

Hi Kalpana,

Create a Function module and implement the above code in it. Execute the Function module ( below the generated IDoc number will be displayed ) and goto WE05 transaction.

Here you can check by giving your IDoc number.

Mark as helpful if it is useful.

Thanks,

Abi

former_member198180
Active Participant
0 Kudos

Hi Abi,

See here there said implement below badi and method for populating all the fileds( they are provide some fields).but customer appointment date shoud be different ,so how to apply logic here,could you please elaborate more...then great help for me..

CRMXIF__ORDER__SAVE__M02-4x/ E101CRMXIF__BUSTRANS/ E101CRMXIF__APPOINTMENT__XT/E101CRMXIF__APPOINTMENT/ TIMESTAMP__FROM  

BADI -ZCRMXIF_ORDER_MAP

Method - CHANGE_MAPPED_DATA_OUT

Thanks

kalpana


Answers (2)

Answers (2)

abibenbella
Explorer
0 Kudos

You can get the appointment date value from the importing parameter of the method CHANGE_MAPPED_DATA_OUT. Map the value to Appointment field in the structure of IDoc ( refer above code )

former_member198180
Active Participant
0 Kudos

Hi team,

could you please help here.

Thanks

kalpana