Using IDOC MATMAS04 - Segment E1MLGNM
Hi all,
I'm using the Idoc Matmas04 to transfer material data between R/3 46C and ECC60.
In my sender system I don't use the Warehouse View, but I must create it in ECC60.
I try to use the BADI_MATMAS_ALE_IN to create the data for the table MLGN_UEB to pass the data in receving system, but the system doesn't create the Warehouse View.
I insert in the internal table MLGN_UEB only the Matnr and LGNUM.
In online transaction the system need only this data.
Can you help me to understand where I'm wrong ?
Thanks a lot
Barbara
Hi Ferry,
when I use the FM IDOC_INPUT_MATMAS01, I don't have the segment E1MLGNM, so the FM doesn't call the customer-exit.
The Idoc that I have is the follow :
MATMAS04 Material Master
E1MARAM Master material general data (MARA)
E1MARA1 Additional Fields for E1MARAM
E1MAKTM Master material short texts (MAKT)
E1MARCM Master material C segment (MARC)
E1MARMM Master material units of measure (MARM)
E1MBEWM Master material material valuation (MBEW)
E1MVKEM Master material sales data (MVKE)
E1MLANM Master material tax classification (MLAN)
E1MTXHM Master material long text header
As ypu can see I don't have the segment E1mlgnm in input in my ECC.
Thanks
Barbara
Similar Messages
-
Hi all,
I have configured an idoc in order to send information of materials to an external warehouse. But this warehouse is only from a specific plant, for only one company. When other companies create their materials, my idoc matmas04 is activated anyway, but this material (idoc) must not be send to this external warehouse. Is there a way to filter the activation of change pointers, in order to activate it only for materials of a specific plant?
Is it possible to create a Z FM copying the standard MASTERIDOC_CREATE_SMD_MATMAS, and create a filter here?
Thanks in advance. Reward points to helpful answers.Hi ,
you need to do create a filter for plant in BD64 ,
You can proceed with following transactions to do so ..............
2.2.2. Maintain object type for message type (BD59) Client independent
The ALE objects are used to create links between IDocs and applications objects, to control the serialisation, to filter messages in the customer model and to use listings.
For our own message type and IDoc you must maintain object types for the links.
If you want to check the serialisation for the message type, then you must maintain object types for the serialisation. If no serialisation object has been maintained for a given message type, then the serialisation will not be checked for this message type.
To add an object type to our message type, follow these next few steps:
Enter transaction BD59 (ALE -> Extensions -> ALE object maintenance -> Maintain object types)
Type in your message type ZINVRV and press enter
Click on New entries
Enter your object type, LIFNR (We need to use the vendor as a filter object), the segment name where LIFNR resides, Z1INVRV, a number 1 for the sequence followed by the actual field name LIFNR
Save and exit.
You have now created an object that well use as a filter object in the customer model to direct the flow of messages to the various logical systems based on the vendors in the filter of the message type ZINVRV.
We now need to add our new message type to the distribution model.
2.3. Configuring the Distribution Model
This task is performed on your ALE reference client.
2.3.1. Manual Configuration (BD64) Client dependent
To manually configure the customer distribution model, read the ALE configuration procedure, and follow these steps:
Perform the Maintain customer distribution model directly function. (ALE -> Distribution customer model -> Maintain customer distribution model directly)
Specify the customer model you want to maintain and the logical system that is to be the sender of the messages OR create a new model. (Create model ALE with logical system ALELS1C400)
Choose the receiving systems to which the sending system must forward message type ZINVRV to.
For each receiving logical system allocate the message type necessary for communication to the receiving systems as per ALE configuration procedure.
Create filter objects (in our case LIFNR as the object type with the associated vendor number, 0000018001 with leading zeros, in the object area) for the message types.
Save the entries. -
Hi,
I am trying to create a PO, using IDocs, in the SAP system. The IDoc will come from a non-SAP system - hence, this is an inbound interface.
Can someone please tell me which Message Type / IDoc Type I should use?
As well, I need to create Characteristics for the Purchase Order. So, I need an IDoc that allows me to create these.
Two options (using existing IDocs):
1. ORDERS/ORDERS05
I have read some of the help documentation and some of the messages posted on this forum and found that the ORDERS/ORDERS05 is used for outbound PO IDocs, and inbound SO IDocs.
Can someone please confirm or correct me? So, this option is OUT.
2. PORDCR/PORDCR05
Apparently, PORDCR/PORDCR05 can be used for inbound PO. However, it does not contain segments for Characteristics. Hence, I will need to extend the IDoc. However, there aren't any useful user-exits to handle the creation of Characteristic values!
Any ideas or suggestions will be greatly rewarded .
Thanks
Bobbyon your points
#1is correct.
#2 yes, if you need any other functionality you need to extend the IDOC. alternately look at BAPI_PO_CREATE* BAPIs to see if they fulfil your requirements -
Problem with HU during creation of Inbound Delivery using IDoc
Hi,
When I am creating Delivery manually and perform Packing, Handling Unit information is stored in VEKP and VEPO tables.
But when I am processing through IDoc, after passing data to Handling Unit Segments E1EDL37 (Handling unit header), E1EDL39 (Control Segment for Handling Units), E1EDL44 (IDoc: Handling Unit Item - Delivery), It is creating delivery successfully but Handling Unit information is not getting stored in VEKP, VEPO tables.
Tried most of the notes 912470, 678464, 682506 and all of them say "<i>You use the Idoc DESADV to create inbound delivery with packing data. The delivery is created, Idoc gets status 52 but the Handling Units (HUs) are missing. This is due to a program error. In case the IDoc contains segments to create HUs (E1EDL37), the IDoc processing should end in error status (51) as long as no packing data could be created</i>.".
Need your advice whether we have to maintain any customizing for this or how to proceed with it.
Thanks in advance,
Murali.IDocs and BAPIs sometimes behave differently than transactions. You might need to add a user exit specifically for IDoc processing. Otherwise send a message to SAP and have them look at it.
-
Working on LSMW using IDoc method for processing Open Sales Orders
We are currently in middle of creation of a new instance of production for a different Business SBU. We are looking to utilise the LSMW tool using IDocs for uploading / transferring the open orders to the new box. If some one has worked on LSMW using IDocs, please get in touch and if you could share any documents on the process of utilising the LSMW tool using Idocs for any kind of conversions, it would be great. The following is a sample case.
1. Each order will have multiple segments with different qualifiers under various segments.
2. Multiple line items would be available under each order.
Issues we are currently looking to solve :
1. How do you manage to loop through the qualifiers during processing for the same segment.
2. How do you prepare the tool to recognise the multiple line items of the same order.
3. What kind of strategy needs to be used to create the input data file(s). Like, splitting the header and detail level information ?
Note : The volume of data we are looking at is somewhere around 40-60 thousand orders worldwide.
Thanks in Advance.hI vikram check this link
and reward points if helpful
http://www.****************/Tutorials/LSMW/IDocMethod/IDocMethod1.htm
http://www.jt77.com/system-dynamics/model-01395.html -
Creation of PO/Contract/Scheduling agreement with ref to PR using IDOC
Hi Experts,
Is it possible to <b>create PO/Contract/Scheduling agreement</b> <b>with reference to PR</b> <b>using inbound IDOC ?</b>
If yes, please let me know the segment type and field to be populated for referencing PR in the IDoc .
Thanks in Advance,
Best Regards,
Mitesh DesaiHi Aarif,
Thanks for taking time to reply .
We are palnning to integrate SAP and non SAP systems.
The business Process is as under .
(1) PR will be generated in ERP (Manaul/MRP)
(2) PR will be coverted into RFQ (for which there is no appropriate source of supply
in ERP)
(3) Sourcing will be done in non SAP system. RFQ will be created with dummy vednro (for example say "source") to identify RFQs to be sent to another system.
These RFQs needs to be sent using IDOC alonwith reference PR numbers and line item numbers.
Multiple PRs will be combined into one RFQ as multiple line items.
(4) Non SAP system will do sourcing and generates either PO or master outline agreement and have reference PR/RFQ numbers and line item numbers.
No SAP system will send PO/outline agreement information to SAP system in XML file format to generate inbound IDOC in SAP .
(5) This inbound idoc will generate PO/outline agreement in SAP.
From SAP functionality point of view, I ca createPO/outline agreement with reference to PR but <b>My Question is how I can generate PO/outline agreement in SAP through IDOC and using "Reference PR or RFQ numbers".</b>
Looking forward to help ASAP.
Regards,
Mitesh Desai -
Transfer data from one server to another server using idocs
hi,crm
i have a data in crm system, i want to download this data and upload into another crm system by using idocs.
please any one explain.Hi Ravi,
my senario is i have to transfer data from crm 5.0 to 7.0.
i have marketing attributes
t-code: bp----> marketing attributes
i want to transfer marketing attributes from A to B.
i created one structure for marketing attributes around 160. and i added this structure fields into custom segments.
i created custom idoc type and i added segments into idoc.
i created one function module for getting data from structure and passing to segments and idoctype.
check the code below.
FUNCTION ZCRMXIF_MKT_DATA.
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(EV_MKT_ATTR) TYPE ZCRMXIF_MKT_STR
Data : c_segment type ZE101CRMXIF_MKT_ATTR_DATA,
c_segment1 type ZE101CRMXIF_MKT_ATTR_DATA1,
c_segment2 type ZE101CRMXIF_MKT_ATTR_DATA2,
c_segment3 type ZE101CRMXIF_MKT_ATTR_DATA3,
c_segment4 type ZE101CRMXIF_MKT_ATTR_DATA4.
data: c_messagetype type c value'zcrmxif_partner_save',
c_idoc_type type c value'zcrmxif_partner_save_mkt',
idoc_control like edidc,
t_comm_control like edidc occurs 0 with header line,
idoc_data like edidd occurs 0 with header line.
data: lt_mkt_attr type Zcrmxif_mkt_str occurs 0 with header line,
ls_mkt_attr like zcrmxif_mkt_str.
loop at lt_mkt_attr.
c_segment-PARTNER = lt_mkt_attr-partner.
c_segment-PARTNER_GUID = lt_mkt_attr-partner_guid.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA' .
idoc_data-sdata = c_segment.
append idoc_data.
c_segment1-ADHAR_NUM = lt_mkt_attr-ADHAR_NUM.
c_segment1-ADULTS = lt_mkt_attr-ADULTS.
c_segment1-AGEGROUP = lt_mkt_attr-AGEGROUP.
c_segment1-AG_CODE = lt_mkt_attr-AG_CODE.
c_segment1-AMERICANEXPRESS = lt_mkt_attr-AMERICANEXPRESS.
c_segment1-ANNUALINCOME = lt_mkt_attr-ANNUALINCOME.
c_segment1-AUTO_TYPE_1 = lt_mkt_attr-AUTO_TYPE_1.
c_segment1-AUTO_TYPE_2 = lt_mkt_attr-AUTO_TYPE_2.
c_segment1-AUTO_TYPE_3 = lt_mkt_attr-AUTO_TYPE_3.
c_segment1-A_HOMEDEL = lt_mkt_attr-A_HOMEDEL.
c_segment1-BANKNAME = lt_mkt_attr-BANKNAME.
c_segment1-BLOODPRESSURE = lt_mkt_attr-BLOODPRESSURE.
c_segment1-BPRELATION = lt_mkt_attr-BPRELATION.
c_segment1-BRAND = lt_mkt_attr-BRAND.
c_segment1-CC1001 = lt_mkt_attr-CC1001.
c_segment1-CC1002 = lt_mkt_attr-CC1002.
c_segment1-CCCLASSIC = lt_mkt_attr-CCCLASSIC.
c_segment1-CCGOLD = lt_mkt_attr-CCGOLD.
c_segment1-CCOTHERS = lt_mkt_attr-CCOTHERS.
c_segment1-CCPLAT = lt_mkt_attr-CCPLAT.
c_segment1-CCREDIT = lt_mkt_attr-CCREDIT.
c_segment1-ccsilver = lt_mkt_attr-ccsilver.
c_segment1-CCTITA = lt_mkt_attr-CCTITA.
c_segment1-CDEBIT = lt_mkt_attr-CDEBIT.
c_segment1-CHILDREN = lt_mkt_attr-CHILDREN.
c_segment1-CITIBANK = lt_mkt_attr-CITIBANK.
c_segment1-CNAPP = lt_mkt_attr-CNAPP.
c_segment1-CNC_PRINT = lt_mkt_attr-CNC_PRINT.
c_segment1-CNC_SIZE = lt_mkt_attr-CNC_SIZE.
c_segment1-CNC_SIZE_NEW = lt_mkt_attr-CNC_SIZE_NEW.
c_segment1-CNC_STATUS = lt_mkt_attr-CNC_STATUS.
c_segment1-CNC_TIME_ZONE = lt_mkt_attr-CNC_TIME_ZONE.
c_segment1-CNC_TIME_ZONE_NEW = lt_mkt_attr-CNC_TIME_ZONE_NEW.
c_segment1-CONDFIRSTZ = lt_mkt_attr-CONDFIRSTZ.
c_segment1-COMPANY = lt_mkt_attr-COMPANY.
c_segment1-CONDSECOND = lt_mkt_attr-CONDSECOND.
c_segment1-CONDTHIRD = lt_mkt_attr-CONDTHIRD.
c_segment1-CUSTOMERTYPE = lt_mkt_attr-CUSTOMERTYPE.
c_segment1-CUST_BUSINESS_NAME = lt_mkt_attr-CUST_BUSINESS_NAME.
c_segment1-DECL_DATE = lt_mkt_attr-DECL_DATE.
c_segment1-DED = lt_mkt_attr-DED.
c_segment1-DIST = lt_mkt_attr-DIST.
c_segment1-DNC = lt_mkt_attr-DNC.
c_segment1-DNCEMAIL = lt_mkt_attr-DNCEMAIL.
c_segment1-DNCPHONE = lt_mkt_attr-DNCPHONE.
c_segment1-DNCPOST = lt_mkt_attr-DNCPOST.
c_segment1-DOB_FAM_2 = lt_mkt_attr-DOB_FAM_2.
c_segment1-DOB_FAM_3 = lt_mkt_attr-DOB_FAM_3.
c_segment1-DOB_FAM_4 = lt_mkt_attr-DOB_FAM_4.
c_segment1-PLANG = lt_mkt_attr-PLANG.
* c_segment1-APPL_SNAME = lt_mkt_attr-APPL_SNAME.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA1'.
idoc_data-sdata = c_segment4.
append idoc_data.
c_segment2-DTPCARDGIVCOU = lt_mkt_attr-DTPCARDGIVCOU.
c_segment2-DTPCARDOFF = lt_mkt_attr-DTPCARDOFF.
c_segment2-DTPCARDOTHSTORE = lt_mkt_attr-DTPCARDOTHSTORE.
c_segment2-DTPCARDRETCOU = lt_mkt_attr-DTPCARDRETCOU.
c_segment2-DTPCARDSHREDDED = lt_mkt_attr-DTPCARDSHREDDED.
c_segment2-DTWELCOMCALL = lt_mkt_attr-DTWELCOMCALL.
c_segment2-DUDZ = lt_mkt_attr-DUDZ.
c_segment2-EDUDR = lt_mkt_attr-EDUDR.
c_segment2-DTPCARDSTORE = lt_mkt_attr-DTPCARDSTORE.
c_segment2-EDUER = lt_mkt_attr-EDUER.
c_segment2-EDUG = lt_mkt_attr-EDUG.
c_segment2-EDUHS = lt_mkt_attr-EDUHS.
c_segment2-EDULAW = lt_mkt_attr-EDULAW.
c_segment2-FOURWHEELER = lt_mkt_attr-FOURWHEELER.
c_segment2-FULL_NAME = lt_mkt_attr-FULL_NAME.
c_segment2-FWLT15KCC = lt_mkt_attr-FWLT15KCC.
c_segment2-FAMILY_MEMBER_NAME = lt_mkt_attr-FAMILY_MEMBER_NAME.
c_segment2-FAMILYMEMBERS = lt_mkt_attr-FAMILYMEMBERS.
c_segment2-FAMILY_MEMBER_NAME_2 = lt_mkt_attr-FAMILY_MEMBER_NAME_2.
c_segment2-FAMILY_MEMBER_NAME_3 = lt_mkt_attr-FAMILY_MEMBER_NAME_3.
c_segment2-FAMILY_MEMBER_NAME_4 = lt_mkt_attr-FAMILY_MEMBER_NAME_4.
c_segment2-FAMILY_MEMBER_NAME_5 = lt_mkt_attr-FAMILY_MEMBER_NAME_5.
c_segment2-FWLT1KCC = lt_mkt_attr-FWLT1KCC.
c_segment2-FWLT2KCC = lt_mkt_attr-FWLT2KCC.
c_segment2-GEO_WING_LAT = lt_mkt_attr-GEO_WING_LAT.
c_segment2-GEO_WING_LONG = lt_mkt_attr-GEO_WING_LONG.
c_segment2-HDFCBANK = lt_mkt_attr-HDFCBANK.
c_segment2-HSBC = lt_mkt_attr-HSBC.
c_segment2-ICICIBANK = lt_mkt_attr-ICICIBANK.
c_segment2-INCMTO = lt_mkt_attr-INCMTO.
c_segment2-INCT2F = lt_mkt_attr-INCT2F.
c_segment2-INCT2T = lt_mkt_attr-INCT2T.
c_segment2-IND_SECTOR = lt_mkt_attr-IND_SECTOR.
c_segment2-INTERNETCHATTING = lt_mkt_attr-INTERNETCHATTING.
c_segment2-LICENSE_INFO = lt_mkt_attr-LICENSE_INFO.
c_segment2-INTERNET_CONNECT = lt_mkt_attr-INTERNET_CONNECT.
c_segment2-MFAM_INCOME = lt_mkt_attr-MFAM_INCOME.
c_segment2-MODEL_1 = lt_mkt_attr-MODEL_1.
c_segment2-MODEL_2 = lt_mkt_attr-MODEL_2.
c_segment2-MODEL_3 = lt_mkt_attr-MODEL_3.
c_segment2-MOTHERS_NAME = lt_mkt_attr-MOTHERS_NAME.
c_segment2-MO_OF_P = lt_mkt_attr-MO_OF_P.
c_segment2-MO_OF_P2 = lt_mkt_attr-MO_OF_P2.
c_segment2-MO_OF_P3 = lt_mkt_attr-MO_OF_P3.
c_segment2-MY_OF_P3 = lt_mkt_attr-MY_OF_P3.
c_segment2-NOMINEES_NAME = lt_mkt_attr-NOMINEES_NAME.
c_segment2-NONE = lt_mkt_attr-NONE.
c_segment2-OCCU_OD_OTHR = lt_mkt_attr-OCCU_OD_OTHR.
c_segment2-OCC_FAM_1 = lt_mkt_attr-OCC_FAM_1.
c_segment2-OCC_FAM_2 = lt_mkt_attr-OCC_FAM_2.
c_segment2-OCC_FAM_3 = lt_mkt_attr-OCC_FAM_3.
c_segment2-OCC_FAM_4 = lt_mkt_attr-OCC_FAM_4.
c_segment2-OCC_FAM_5 = lt_mkt_attr-OCC_FAM_5.
c_segment2-OCC_NOM = lt_mkt_attr-OCC_NOM.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA2'.
idoc_data-sdata = c_segment4.
append idoc_data.
C_segment3-PLANG_OTHR = lt_mkt_attr-PLANG_OTHR.
C_segment3-REF_MAILADD = lt_mkt_attr-REF_MAILADD.
C_segment3-RELATION_FAM_1 = lt_mkt_attr-RELATION_FAM_1.
C_segment3-RELATION_FAM_2 = lt_mkt_attr-RELATION_FAM_2.
C_segment3-RELATION_FAM_3 = lt_mkt_attr-RELATION_FAM_3.
C_segment3-RELATION_FAM_4 = lt_mkt_attr-RELATION_FAM_4.
C_segment3-RELATION_FAM_5 = lt_mkt_attr-RELATION_FAM_5.
C_segment3-REL_ACTIVE_STAT = lt_mkt_attr-REL_ACTIVE_STAT.
C_segment3-REL_KISAN_MITRA_STAT = lt_mkt_attr-REL_KISAN_MITRA_STAT.
C_segment3-REL_NOM = lt_mkt_attr-REL_NOM.
C_segment3-REL_PLASTIC_CARD_STAT = lt_mkt_attr-REL_PLASTIC_CARD_STAT.
C_segment3-REL_STAFF_STAT = lt_mkt_attr-REL_STAFF_STAT.
C_segment3-REMARKS = lt_mkt_attr-REMARKS.
C_segment3-ROCN = lt_mkt_attr-ROCN.
C_segment3-ROCN_FAM_1 = lt_mkt_attr-ROCN_FAM_1.
C_segment3-ROCN_FAM_2 = lt_mkt_attr-ROCN_FAM_2.
C_segment3-ROCN_FAM_3 = lt_mkt_attr-ROCN_FAM_3.
C_segment3-ROCN_FAM_4 = lt_mkt_attr-ROCN_FAM_4.
C_segment3-ROOMS_PER_FLAT = lt_mkt_attr-ROOMS_PER_FLAT.
C_segment3-SCH_NUM = lt_mkt_attr-SCH_NUM .
C_segment3-SECONDARYEMAIL = lt_mkt_attr-SECONDARYEMAIL.
C_segment3-SERIAL_NUM = lt_mkt_attr-SERIAL_NUM.
C_segment3-SOCIETY_MEMBER = lt_mkt_attr-SOCIETY_MEMBER.
C_segment3-SOC_CONTNO_LL = lt_mkt_attr-SOC_CONTNO_LL.
C_segment3-SOC_CONTNO_MOB = lt_mkt_attr-SOC_CONTNO_MOB.
C_segment3-SOC_CONT_DESIG = lt_mkt_attr-SOC_CONT_DESIG.
C_segment3-SOC_CONT_PER_NAM = lt_mkt_attr-SOC_CONT_PER_NAM.
C_segment3-STANCHART = lt_mkt_attr-STANCHART.
C_segment3-ST_CODE = lt_mkt_attr-ST_CODE.
C_segment3-ST_CODE_OLD = lt_mkt_attr-ST_CODE_OLD.
C_segment3-ST_EMP_CODE = lt_mkt_attr-ST_EMP_CODE.
C_segment3-TEENAGERS = lt_mkt_attr-TEENAGERS.
C_segment3-SBI = lt_mkt_attr-SBI.
C_segment3-ZLAT1 = lt_mkt_attr-ZLAT1.
C_segment3-ZLONG1 = lt_mkt_attr-ZLONG1.
C_segment3-ZWING_GEOCODE = lt_mkt_attr-ZWING_GEOCODE.
C_segment3-ZNAMEPLATE_PHOTO = lt_mkt_attr-ZNAMEPLATE_PHOTO.
C_segment3-ZLATITUDE = lt_mkt_attr-ZLATITUDE.
C_segment3-ZLONGITUDE = lt_mkt_attr-ZLONGITUDE.
C_segment3-ZLATITUDE_N_LONGITUDE = lt_mkt_attr-ZLATITUDE_N_LONGITUDE.
C_segment3-ZWING_PHOTO = lt_mkt_attr-ZWING_PHOTO.
C_segment3-ZCATEGORY_SHOPS = lt_mkt_attr-ZCATEGORY_SHOPS.
C_segment3-ZNUM_OF_SHOPS = lt_mkt_attr-ZNUM_OF_SHOPS.
C_segment3-ZELECT_SURVILL = lt_mkt_attr-ZELECT_SURVILL.
C_segment3-ZBUILDING_TYPE = lt_mkt_attr-ZBUILDING_TYPE.
C_segment3-ZFLATS_PER_FLOOR = lt_mkt_attr-ZFLATS_PER_FLOOR.
C_segment3-ZBULDNG_FLOOR = lt_mkt_attr-ZBULDNG_FLOOR.
C_segment3-ZSWIMMING_POOL = lt_mkt_attr-ZSWIMMING_POOL.
C_segment3-ZGYM = lt_mkt_attr-ZGYM.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA3'.
idoc_data-sdata = c_segment4.
append idoc_data.
c_segment4-others = lt_mkt_attr-others.
c_segment4-OCCU_OD = lt_mkt_attr-OCCU_OD.
c_segment4-ZFLAT_TYPE = lt_mkt_attr-ZFLAT_TYPE.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA4'.
idoc_data-sdata = c_segment4.
append idoc_data.
ENDLOOP.
IDOC_CONTROL-MESTYP = c_messagetype.
IDOC_CONTROL-DOCTYP = c_idoc_type.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = IDOC_CONTROL
* OBJ_TYPE = ''
* CHNUM = ''
TABLES
COMMUNICATION_IDOC_CONTROL = t_comm_control
MASTER_IDOC_DATA = IDOC_DATA
* EXCEPTIONS
* ERROR_IN_IDOC_CONTROL = 1
* ERROR_WRITING_IDOC_STATUS = 2
* ERROR_IN_IDOC_DATA = 3
* SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
* OTHERS = 5
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFUNCTION.
i implement a badi "CRMXIF_PARTNER_MAP"
data ls_mkt_attr type zcrmxif_mkt_str.
LOOP AT cs_data_mapped INTO ls_data_mapped .
lv_tabix = sy-tabix.
loop at ls_data_mapped-ZZPARTNER-ZZMKT_ATTR into ls_mkt_attr.
read table ls_data_mapped-zzpartner-ZZMKT_ATTR into ls_mkt_attr index 1.
if ls_mkt_attr is not initial.
CALL FUNCTION 'ZCRMXIF_MKT_DATA'
EXPORTING
EV_MKT_ATTR = ls_mkt_attr
endif.
endloop.
read table ls_data_mapped-zzpartner-ZZMKT_ATTR into ls_mkt_attr index 1.
MODIFY cs_data_mapped FROM ls_data_mapped INDEX lv_tabix.
endloop.
i ddn't get data into sructure.
please explain how to doit. -
Issue In Posting Proof Of Delivery Using Idoc using Message Type STPPOD
Hi ,
(The details I have attached in the below file.)
We are trying to perform proof of delivery with respect to a outbound delivery via IDOC using idoc inbound function module IDOC_INPUT_STPPOD.
Everything is working fine except when it is creating a new stock movement document on confirmation of proof of delivery, the newly created stock movement document is not reflecting the actual received quantity instead it is showing the the Actual Delivery quantity.
For clicking on the button - "Proof of Delivery Confirmation " (green wright symbol) and change the overall POD status as completed ( depending on this status C the stock movement document gets created) we did a custom coding in the customer exit of IDOC_INPUT_STPPOD.
The details I have attached in the below file.
I am not able to understand where I am making mistake due to which, the quantity on the stock movement document after proof of delivery confirmation is not reflecting the actual received quantity.
Can you please suggest what necessary coding changes I need to perform to make it work properly.
Regards
Saifur RahamanHi Thripura,
In DELVRY03 Idoc type,there is a segment E1EDL37 containing Shipment Header Information.As a header segment,there are 6 segments under this,which contains other details.Please see the below details.
E1EDL37 Shipping unit header
E1EDL39 Control segment for shipping units
E1EDL38 Shipping unit header descriptions
E1EDL49 Express Delivery Company's Tracking Connection Data
E1EDL50 Express Delivery Company - Additional Data
E1EDL44 IDoc: Shipping unit item (delivery)
E1EDL46 Serial Numbers HU
Regards,
VSN -
How to attempt production orders and get feedback by using IDocs
Hi,
I'm new new to SAP and R3 respectively mySAP. I need to know how to use IDocs (over file system) to attempt production orders to an extern application and how to get the feedback of the whole orders and single operations.
I found the IDoc-base-type "PPCC2RECORDER01" to send production orders. Is that the right base type for production orders?
(In consideration of compatibility and support me was recommend to avoid the old types OPERA2 and CONF21.)
What IDoc-types do I need to get feedback about a production order and its operations?
I hope someone is understanding my questions is able to help me. Please apologize my broken English.
Thanks!
HannesPROGRAM....... ZRCCLORDPROC
TITLE......... Production Odrer Idocs
AUTHOR........ Aveek Ghose
DATE WRITTEN.. 15/09/2006
R/3 RELEASE... 4.6C
=====================================================================*
COPIED FROM... N/A
DESCRIPTION...
*& Creation of production order IDOCs to a given selection
*& This program selects to an input given via the selection screen the *
*& corresponding production orders from the database. Then the function
*& module for creation of planned order idocs is called. *
*& In general this report is called from the report RCCLTRAN, but it *
*& can also be used for its own. *
=====================================================================*
PROGRAM TYPE.. Outbound Interface
DEV. CLASS.... ZPD1
LOGICAL DB.... N/A
=====================================================================*
SCREENS....... N/A
GUI TITLE..... N/A
GUI STATUS.... N/A
TRANSACTIONS.. N/A
USER EXITS.... N/A
=====================================================================*
CHANGE HISTORY *
Date By Correction Number & Brief Description Release
Tables / Structures
REPORT zrcclordproc
NO STANDARD PAGE HEADING
MESSAGE-ID ZCUST
LINE-COUNT 65(0)
LINE-SIZE 255.
INCLUDE RCORDO01. " PBO-Modules *
INCLUDE RCORDI01. " PAI-Modules *
INCLUDE RCORDF01. " FORM-Routines *
--> Global data
TYPE-POOLS: cloi.
include zprodata. "Types / constants for Orderselection
include zrcordtop. "Tables / Data for this report
include zrcordtop1.
include yrccl_constants.
TABLES : jcds,
tvarv,
zzzz_xref_data.
TYPES: BEGIN OF ty_date,
aufnr TYPE aufnr,
aedat TYPE aufaedat,
aezeit TYPE co_chg_time,
erdat TYPE auferfdat,
erfzeit TYPE co_ins_time,
loekz TYPE aufloekz,
indicator(1) TYPE c,
END OF ty_date.
DATA: is_enhancement type isu_ord_segments_determine.
DATA: itab_date TYPE STANDARD TABLE OF ty_date
INITIAL SIZE 0 WITH HEADER LINE.
DATA: f_objnr TYPE j_objnr.
DATA: g_report_sub_head(72) TYPE c, "Sub-Header hold area
g_report_head(72) TYPE c, "Header hold area
g_run_date(72) TYPE c, "Holds message for Run date
g_run_time(72) TYPE c. "Holds message for Run time
DATA:
f_old_date TYPE datum,
f_old_time TYPE uzeit,
f_continue(1) TYPE c.
END OF INSERTION DS001
--> Überschrift für sonstige Einstellungen
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN BEGIN OF BLOCK miscellaneous WITH FRAME.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN COMMENT 1(30) text-001. "#EC
SELECTION-SCREEN SKIP 1.
*>> Logical system comes from Report RCCLTRANS
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(30) text-002.
SELECTION-SCREEN POSITION 35.
PARAMETERS opt_sys LIKE tbdlst-logsys.
SELECTION-SCREEN END OF LINE.
*>> Messagetype comes from Report RCCLTRANS
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(30) text-003.
SELECTION-SCREEN POSITION 35.
PARAMETERS mestyp LIKE tbdme-mestyp.
SELECTION-SCREEN END OF LINE.
*>> Messagetype comes from Report RCCLTRANS
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(30) text-004.
SELECTION-SCREEN POSITION 35.
PARAMETERS: p_date TYPE sydatum. "last run date
SELECTION-SCREEN END OF LINE.
*>> Messagetype comes from Report RCCLTRANS
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(30) text-005.
SELECTION-SCREEN POSITION 35.
PARAMETERS: p_time TYPE syuzeit. "last run time
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK MISCELLANEOUS.
*MOD-006
*>> Messagetype comes from Report RCCLTRANS
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(30) text-006.
SELECTION-SCREEN POSITION 35.
PARAMETERS: p_update AS CHECKBOX DEFAULT space.
SELECTION-SCREEN END OF LINE.
*MOD-006
*MOD-006
*>> Messagetype comes from Report RCCLTRANS
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(30) text-007.
SELECTION-SCREEN POSITION 32.
SELECT-OPTIONS: s_rundt FOR sy-datum NO-EXTENSION.
SELECTION-SCREEN END OF LINE.
*MOD-006
*MOD-006
*>> Messagetype comes from Report RCCLTRANS
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(30) text-008.
SELECTION-SCREEN POSITION 32.
SELECT-OPTIONS: s_runtm FOR sy-uzeit NO-EXTENSION.
SELECTION-SCREEN END OF LINE.
*MOD-006
**MOD-006
*SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN COMMENT 3(30) text-009.
*SELECTION-SCREEN POSITION 32.
*SELECT-OPTIONS: s_emat FOR zzzz_xref_data-z_in_value.
*SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK miscellaneous.
**MOD-006
Write selected AUFPL numbers via ranges table to memory ?
PARAMETERS:
ordtomem TYPE cloi_x DEFAULT '' NO-DISPLAY. "X: yes
do not select from MARC, but use ranges tables directly. MK 4.0C
matnr_gl and werks_gl must have the same length.
PARAMETERS: no_sel TYPE c DEFAULT ' ' NO-DISPLAY.
--> Normal selection parameters for ORD comes from the logical db
*& Event START-OF-SELECTION
START-OF-SELECTION.
--> Select the ORD according to the selected
MRP controller, Material, work center and plant
*MOD-006
Validate the last run date & Time
PERFORM validate_last_run_date_time.
*MOD-006
BEGIN OF INSERTION DS001
get the entry of the last program run
select single * for update from ycloidownlprot
where logsys = OPT_SYS and
downloadtype eq C_DOWNL_PROCESS_ORDERS.
if YCLOIDOWNLPROT-IN_PROGRESS eq CLOI_TRUE.
program is already running, do not allow to start again
write : / text-004, YCLOIDOWNLPROT-USERNAME.
exit.
endif.
YCLOIDOWNLPROT-MANDT = SY-MANDT.
YCLOIDOWNLPROT-LOGSYS = OPT_SYS.
YCLOIDOWNLPROT-START_DATE = SY-DATUM.
YCLOIDOWNLPROT-START_TIME = SY-UZEIT.
YCLOIDOWNLPROT-USERNAME = SY-UNAME.
YCLOIDOWNLPROT-DOWNLOADTYPE = C_DOWNL_PROCESS_ORDERS.
YCLOIDOWNLPROT-IN_PROGRESS = CLOI_TRUE.
insert or update entry (dependant if entry already exists)
MODIFY YCLOIDOWNLPROT.
COMMIT WORK.
CLEAR CREATED_MASTERIDOCS_PRO.
EXPORT CREATED_MASTERIDOCS_PRO TO MEMORY ID 'YLOI001'.
END OF INSERTION DS001
BEGIN OF INSERTION DS001
if not sscrfields-ucomm = 'ONLI'. mk zu 4.0
exit.
endif.
if s_dispo is initial and
s_matnr is initial and
s_arbpl is initial and
s_werks is initial.
exit.
endif.
Send only orders with type 40 - process orders
p_autyp = '40'.
END OF INSERTION DS001
*>> Put the ranges tabs back into matwrk list if no selection (NO_SEL)
IF no_sel = cloi_true.
CLEAR t_matwrk_key. REFRESH t_matwrk_key.
LOOP AT s_matnr.
t_matwrk_key-matnr = s_matnr-low.
READ TABLE s_werks INDEX sy-tabix.
t_matwrk_key-werks = s_werks-low.
APPEND t_matwrk_key.
ENDLOOP.
SORT t_matwrk_key BY matnr werks.
DELETE ADJACENT DUPLICATES FROM t_matwrk_key.
delete duplicate duplicates from ranges table. Therfore sort by LOW
(HIGH is not used in this case).
SORT s_matnr BY low.
DELETE ADJACENT DUPLICATES FROM s_matnr.
SORT s_werks BY low.
DELETE ADJACENT DUPLICATES FROM s_werks.
ENDIF.
--> Determine which segments are selected in the message type
PERFORM ord_segments_determine
USING mestyp
CHANGING afpo_x
jstk_x
afab_x
affl_x
afvo_x
kbed_x
jstv_x
resb_x
kbeu_x
afuv_x
is_enhancement
jstu_x.
Export the flags to the memory, because the following subroutine
must not have any parameters !!!
EXPORT affl_x
afvo_x
kbed_x
resb_x
kbeu_x
afuv_x
TO MEMORY ID 'LOI03'.
MK 19980326 enhanced selections on header/operation level
get selection profile for log system from customizing if available
SELECT SINGLE * FROM tcloi9 WHERE logsys = opt_sys.
if entry exists for the logical system
IF sy-subrc = 0.
if an selection profile for the order is entered, use it for selection
IF NOT tcloi9-ord_selid IS INITIAL.
p_selid = tcloi9-ord_selid.
ENDIF.
IF NOT tcloi9-ord_opr_selid IS INITIAL AND
NOT afvo_x IS INITIAL AND NOT affl_x IS INITIAL.
ord_opr_selid = tcloi9-ord_opr_selid.
ENDIF.
ENDIF.
initialize control key table for selections
CALL FUNCTION 'CLOI_STEUS_GET'
EXPORTING
logsys_to_init = opt_sys
IMPORTING
no_entry_for_logsys = no_entry_for_logsys
TABLES
t_steus = t_steus
EXCEPTIONS
logsys_not_initialized = 1
OTHERS = 2.
Write structure information into the memory
perform fill_memory_selobj.
-> import table with already sent orders
IMPORT gt_aufnrdone FROM MEMORY ID 'LOIAUFNRTAB'. "N599845
SORT gt_aufnrdone BY low. "N599845
--> Read header information
GET ioheader.
Check if material/plant combination is selected MK 4.0C
CLEAR check_flg.
IF no_sel = cloi_true.
READ TABLE t_matwrk_key
WITH KEY matnr = ioheader-matnr
werks = ioheader-werks BINARY SEARCH.
IF sy-subrc <> 0.
check_flg = cloi_true.
ENDIF.
ENDIF.
-> check if order was already sent
IF NOT gt_aufnrdone[] IS INITIAL. "N599845
READ TABLE gt_aufnrdone WITH KEY "N599845
low = ioheader-aufnr "N599845
TRANSPORTING NO FIELDS "N599845
BINARY SEARCH. "N599845
IF sy-subrc = 0. "N599845
-> order already sent
check_flg = cloi_true. "N599845
ENDIF. "N599845
ENDIF. "N599845
leave GET routine if check_flg is set.
CHECK check_flg IS INITIAL.
CLEAR t_afpo. REFRESH t_afpo.
CLEAR t_affl. REFRESH t_affl.
MOVE-CORRESPONDING ioheader TO t_afko.
GET ioheader LATE.
BEGIN OF INSERTION DS001
Check whether the process order has been changed since the last
run of the program
clear f_continue.
if the CHANGED date is greater than the last run or initial
IF IOHEADER-AEDAT GT F_OLD_DATE OR
( ioheader-aedat is initial and
ioheader-aezeit is initial ).
if the CHANGED date is initial check the creation date
if ioheader-aedat is initial.
if the creation date is greater than or equal to the date of the last
run, if it is equal the creation time must be later or equal to the
start time of the last run
IF IOHEADER-ERDAT GT F_OLD_DATE OR
( IOHEADER-ERDAT EQ F_OLD_DATE AND
IOHEADER-ERFZEIT GE F_OLD_TIME ).
f_continue = 'X'.
endif.
else.
f_continue = 'X'.
endif.
if the CHANGED dat is not initial check it against the last run
ELSEIF IOHEADER-AEDAT EQ F_OLD_DATE AND
IOHEADER-AEZEIT GE F_OLD_TIME.
f_continue ='X'.
endif.
Aenderung 295/99 Selektions-Aenderung vom 26. August 99
Wenn Auftrag bereits techn. abgeschlossen ist, so darf kein IDOC
erzeugt werden, wenn Auftrag zum löschen vorgemerkt wird.
CONCATENATE 'OR' IOHEADER-AUFNR INTO F_OBJNR.
SELECT SINGLE * FROM JEST
WHERE OBJNR = F_OBJNR
AND STAT = 'I0045'.
IF JEST-INACT EQ SPACE AND SY-SUBRC EQ 0.
SELECT * FROM JCDS WHERE OBJNR EQ F_OBJNR AND
STAT EQ 'I0045' AND
INACT EQ SPACE.
letzte Aenderung des Status TABG wird geprueft Beg. WA 354/99
ENDSELECT.
IF ( F_OLD_DATE GT JCDS-UDATE OR " Beg JB_02
( F_OLD_DATE EQ JCDS-UDATE AND
F_OLD_TIME GT JCDS-UTIME ) ) AND " End JB_02
SY-SUBRC EQ 0.
CLEAR F_CONTINUE.
ENDIF.
ENDIF.
Ende 295/99
check f_continue eq 'X'.
END OF INSERTION DS001
t_afko-t_afpo = t_afpo[].
t_afko-t_jstk = t_jstk[].
t_afko-t_affl = t_affl[].
t_afko-t_afab = t_afab[].
APPEND t_afko.
IF jstk_x = cloi_x.
t_objnr-objnr = ioheader-objnr.
APPEND t_objnr.
ENDIF.
*---> Remember the orders that are already selected for the global
selection parameters
IF ordtomem = cloi_x. "write order numbers to memory
t_aufnr_range_done-sign = 'I'.
t_aufnr_range_done-option = 'NE'.
t_aufnr_range_done-low = ioheader-aufpl.
APPEND t_aufnr_range_done.
ENDIF.
*---> Remember the orders internal/external keys for AFAB (relationship)
IF afab_x = cloi_x.
MOVE-CORRESPONDING ioheader TO t_aufpl_aufnr.
APPEND t_aufpl_aufnr.
ENDIF.
check afpo_x = cloi_x.
GET ioitem.
BEGIN OF INSERTION DS001
Check whether the process order has been changed since the last
run of the program
CLEAR F_CONTINUE.
if the CHANGED date is greater than the last run or initial
IF IOHEADER-AEDAT GT F_OLD_DATE OR
( ioheader-aedat is initial and
ioheader-aezeit is initial ).
if the CHANGED date is initial check the creation date
if ioheader-aedat is initial.
if the creation date is greater than or equal to the date of the last
run, if it is equal the creation time must be later or equal to the
start time of the last run
IF IOHEADER-ERDAT GT F_OLD_DATE OR
( IOHEADER-ERDAT EQ F_OLD_DATE AND
IOHEADER-ERFZEIT GE F_OLD_TIME ).
f_continue = 'X'.
endif.
else.
f_continue = 'X'.
endif.
if the CHANGED date is not initial check it against the last run
ELSEIF IOHEADER-AEDAT EQ F_OLD_DATE AND
IOHEADER-AEZEIT GE F_OLD_TIME.
f_continue ='X'.
endif.
Aenderung 295/99 Selektions-Aenderung vom 26. August 99
Wenn Auftrag bereits techn. abgeschlossen ist, so darf kein IDOC
erzeugt werden, wenn Auftrag zum löschen vorgemerkt wird.
CONCATENATE 'OR' IOHEADER-AUFNR INTO F_OBJNR.
SELECT SINGLE * FROM JEST
WHERE OBJNR = F_OBJNR
AND STAT = 'I0045'.
IF JEST-INACT EQ SPACE AND SY-SUBRC EQ 0.
SELECT * FROM JCDS WHERE OBJNR EQ F_OBJNR AND
STAT EQ 'I0045' AND
INACT EQ SPACE.
letzte Aenderung des Status TABG wird geprueft
ENDSELECT.
IF ( F_OLD_DATE GT JCDS-UDATE OR " Beg JB_02
( F_OLD_DATE EQ JCDS-UDATE AND
F_OLD_TIME GT JCDS-UTIME ) ) AND " End JB_02
SY-SUBRC EQ 0.
CLEAR F_CONTINUE.
ENDIF.
ENDIF.
Ende 295/99
check f_continue eq 'X'.
END OF INSERTION DS001
IF afpo_x = cloi_x.
MOVE-CORRESPONDING ioitem TO t_afpo.
APPEND t_afpo.
ENDIF.
Put matnr and ltrmi in a help structure, which later goes to t_afpo
IF ioitem-posnr = '0001'.
MOVE-CORRESPONDING ioitem TO help_afpo.
APPEND help_afpo.
put PSP element (internal key) into order header. Unique for positions
IF t_afko-pspel IS INITIAL.
t_afko-pspel = ioitem-projn.
ENDIF.
ENDIF.
CHECK affl_x = cloi_x.
GET iosequen.
CLEAR t_afvo. REFRESH t_afvo.
MOVE-CORRESPONDING iosequen TO t_affl.
GET iosequen LATE.
t_affl-t_afvo = t_afvo[].
APPEND t_affl.
CHECK afvo_x = cloi_x.
GET iooper.
CLEAR t_kbed. REFRESH t_kbed.
CLEAR t_afuv. REFRESH t_afuv.
CLEAR t_resb. REFRESH t_resb.
MOVE-CORRESPONDING iooper TO t_afvo.
"Temporary storing of operation information if for a phase
"the corresponding operation has is needed
MOVE-CORRESPONDING iooper TO t_aufpl_aplzl_vornr.
APPEND t_aufpl_aplzl_vornr.
check, if selection profile (if exists) for the operation is ok
IF NOT ord_opr_selid IS INITIAL.
CALL FUNCTION 'STATUS_CHECK_BY_SELSCHEM'
EXPORTING
objnr = iooper-objnr
selid = ord_opr_selid
IMPORTING
fullfill = status_ok
EXCEPTIONS
no_stat_tab = 1
no_stat_scheme = 2
OTHERS = 3.
IF sy-subrc <> 0.
status_ok = cloi_x.
ENDIF.
ELSE.
status_ok = cloi_x.
ENDIF.
check if control key (STEUS) should not be selected.
control_key_ok = cloi_x.
IF no_entry_for_logsys IS INITIAL.
READ TABLE t_steus WITH KEY
steus = iooper-steus BINARY SEARCH.
IF sy-subrc <> 0.
CLEAR control_key_ok.
ENDIF.
ENDIF.
CHECK NOT status_ok IS INITIAL.
CHECK NOT control_key_ok IS INITIAL.
GET iooper LATE.
t_afvo-t_kbed = t_kbed[].
t_afvo-t_afuv = t_afuv[].
t_afvo-t_resb = t_resb[].
APPEND t_afvo.
IF jstv_x = cloi_x.
t_objnr-objnr = iooper-objnr.
APPEND t_objnr.
ENDIF.
CHECK kbed_x = cloi_x.
GET ioopcap.
MOVE-CORRESPONDING ioopcap TO t_kbed.
APPEND t_kbed.
CHECK resb_x = cloi_x.
GET ioopcomp.
do not transfer RESB entries with deletion flag
CHECK ioopcomp-xloek IS INITIAL.
MOVE-CORRESPONDING ioopcomp TO t_resb.
APPEND t_resb.
CHECK afuv_x = cloi_x.
GET iosoper.
CLEAR t_kbeu. REFRESH t_kbeu.
MOVE-CORRESPONDING iosoper TO t_afuv.
check if control key (STEUS) should not be selected.
control_key_ok = cloi_x.
IF no_entry_for_logsys IS INITIAL.
READ TABLE t_steus WITH KEY
steus = iooper-steus BINARY SEARCH.
IF sy-subrc <> 0.
CLEAR control_key_ok.
ENDIF.
ENDIF.
CHECK NOT control_key_ok IS INITIAL.
GET iosoper LATE.
t_afuv-t_kbeu = t_kbeu[].
APPEND t_afuv.
IF jstv_x = cloi_x.
t_objnr-objnr = iosoper-objnr.
APPEND t_objnr.
ENDIF.
CHECK kbeu_x = cloi_x.
GET iosocap.
MOVE-CORRESPONDING iosocap TO t_kbeu.
APPEND t_kbeu.
*& Event END-OF-SELECTION
END-OF-SELECTION.
*MOD-006
DATA: itab_matnr TYPE zzzz_xref_data OCCURS 0.
DATA: l_wa_matnr TYPE zzzz_xref_data.
DATA: l_wa_matnr_value TYPE zzzz_xref_data-z_in_value.
DATA: l_wa_afko TYPE cloi_afko_struct.
SELECT *
FROM zzzz_xref_data
APPENDING TABLE itab_matnr
WHERE trans_id = 'ZELCUSMATLOOKUP' AND
( z_in_value IN s_matnr OR
z_out_value IN s_matnr ).
IF sy-subrc = 0.
LOOP AT ITAB_MATNR INTO L_WA_MATNR.
L_WA_MATNR_VALUE = L_WA_MATNR-z_OUT_VALUE.
S_MATNR-LOW = L_WA_MATNR_VALUE.
S_MATNR-SIGN = 'I'.
S_MATNR-OPTION = 'EQ'.
APPEND S_MATNR.
ENDLOOP.
DELETE itab_matnr WHERE NOT in_value IN s_emat.
SORT itab_matnr BY out_value.
ENDIF.
CLEAR: l_wa_matnr.
**MOD-010
Data which is not in the material lookup table but in the T_AFKO.
LOOP AT t_afko INTO l_wa_afko.
READ TABLE S_MATNR WITH KEY LOW = L_WA_AFKO-MATNR BINARY SEARCH.
READ TABLE itab_matnr INTO l_wa_matnr
WITH KEY z_out_value = l_wa_afko-matnr BINARY SEARCH.
IF sy-subrc NE 0.
l_wa_afko-rgekz = 'X'.
MODIFY t_afko FROM l_wa_afko TRANSPORTING rgekz.
ENDIF.
IF NOT P_DATE IS INITIAL.
IF T_AFKO-GSTRP < p_date OR
( T_AFKO-GSTRP = p_date AND
T_AFKO-GSUZP > p_time ).
L_WA_AFKO-RGEKZ = 'X'.
MODIFY T_AFKO FROM L_WA_AFKO TRANSPORTING RGEKZ.
ENDIF.
ENDIF.
ENDLOOP.
Delete Data which is not in the material lookup
table but in the T_AFKO.
DELETE t_afko WHERE rgekz = 'X'.
*MOD-010
*MOD-006
BEGIN OF INSERTION DS001
DATA: l_wa_itab_date TYPE ty_date.
Check whether the process order has been changed since the last
run of the program
CLEAR f_continue.
IF NOT t_afko IS INITIAL.
SELECT aufnr aedat aezeit erdat erfzeit loekz
INTO TABLE itab_date
FROM aufk
FOR ALL ENTRIES IN t_afko
WHERE aufnr = t_afko-aufnr.
IF sy-subrc = 0.
IF NOT p_date IS INITIAL.
CLEAR: itab_date.
Check whether the process order has been changed since the last
run of the program
LOOP AT itab_date INTO l_wa_itab_date.
if the CHANGED date is greater than the last run or initial
IF l_wa_itab_date-aedat GT p_date OR
( l_wa_itab_date-aedat IS INITIAL AND
l_wa_itab_date-aezeit IS INITIAL ).
if the CHANGED date is initial check the creation date
IF l_wa_itab_date-aedat IS INITIAL.
if the creation date is greater than or equal to the date of the last
run, if it is equal the creation time must be later or equal to the
start time of the last run
IF l_wa_itab_date-erdat GT p_date OR
( l_wa_itab_date-erdat EQ p_date AND
l_wa_itab_date-erfzeit GE p_time ).
f_continue = 'X'.
ELSE.
l_wa_itab_date-indicator = 'X'.
MODIFY itab_date FROM l_wa_itab_date TRANSPORTING indicator.
ENDIF.
ELSE.
f_continue = 'X'.
ENDIF.
if the CHANGED dat is not initial check it against the last run
ELSEIF l_wa_itab_date-aedat EQ p_date AND
l_wa_itab_date-aezeit GE p_time.
f_continue ='X'.
ELSE.
l_wa_itab_date-indicator = 'X'.
MODIFY itab_date FROM l_wa_itab_date TRANSPORTING indicator.
ENDIF.
ENDLOOP.
*MOD-006
ELSE.
CLEAR: ITAB_DATE.
LOOP AT ITAB_DATE INTO L_WA_ITAB_DATE.
if the CHANGED date is greater than the last run or initial
IF L_WA_ITAB_DATE-AEDAT GT P_RUNDT OR
( L_WA_ITAB_DATE-aedat is initial and
L_WA_ITAB_DATE-aezeit is initial ).
if the CHANGED date is initial check the creation date
if l_wa_itab_date-aedat is initial.
if the creation date is greater than or equal to the date of the last
run, if it is equal the creation time must be later or equal to the
start time of the last run
IF L_WA_ITAB_DATE-ERDAT GT P_RUNDT OR
( L_WA_ITAB_DATE-ERDAT EQ P_RUNDT AND
L_WA_ITAB_DATE-ERFZEIT GE S_RUNTM-LOW OR
L_WA_ITAB_DATE-ERFZEIT LE S_RUNTM-HIGH ).
f_continue = 'X'.
else.
l_wa_itab_date-indicator = 'X'.
MODIFY ITAB_DATE FROM L_WA_ITAB_DATE
TRANSPORTING INDICATOR.
endif.
else.
f_continue = 'X'.
endif.
if the CHANGED dat is not initial check it against the last run
ELSEIF L_WA_ITAB_DATE-AEDAT EQ P_RUNDT AND
L_WA_ITAB_DATE-AEZEIT GE S_RUNTM-LOW.
f_continue ='X'.
ELSE.
l_wa_itab_date-indicator = 'X'.
MODIFY ITAB_DATE FROM L_WA_ITAB_DATE
TRANSPORTING INDICATOR.
endif.
ENDLOOP.
*MOD-006
ENDIF.
ENDIF.
ENDIF.
DELETE ITAB_DATE WHERE INDICATOR = 'X'.
*MOD-006
CLEAR: itab_date.
IF s_rundt-high IS INITIAL AND NOT s_rundt IS INITIAL.
s_rundt-high = sy-datum.
ENDIF.
LOOP AT itab_date INTO l_wa_itab_date.
IF NOT s_rundt IS INITIAL.
if the CHANGED date is greater than the last run or initial
IF ( l_wa_itab_date-aedat IS INITIAL AND
l_wa_itab_date-aezeit IS INITIAL ).
if the CHANGED date is initial check the creation date
IF l_wa_itab_date-aedat IS INITIAL.
if the creation date is greater than or equal to the date of the last
run, if it is equal the creation time must be later or equal to the
start time of the last run
IF ( l_wa_itab_date-erdat GT s_rundt-low AND
l_wa_itab_date-erfzeit GT s_runtm-low ) AND
( l_wa_itab_date-erdat LT s_rundt-high AND
l_wa_itab_date-erfzeit LT s_runtm-high ).
f_continue = 'X'.
ELSE.
l_wa_itab_date-indicator = 'X'.
MODIFY itab_date FROM l_wa_itab_date
TRANSPORTING indicator.
ENDIF.
ELSE.
f_continue = 'X'.
ENDIF.
if the CHANGED dat is not initial check it against the last run
ELSEIF ( l_wa_itab_date-aedat GE s_rundt-low AND
l_wa_itab_date-aezeit GE s_runtm-low ) AND
( l_wa_itab_date-aedat LE s_rundt-high AND
l_wa_itab_date-aezeit LE s_runtm-high ).
f_continue ='X'.
ELSE.
l_wa_itab_date-indicator = 'X'.
MODIFY itab_date FROM l_wa_itab_date
TRANSPORTING indicator.
ENDIF.
ENDIF.
ENDLOOP.
DELETE itab_date WHERE indicator = 'X'.
*MOD-006
**MOD-006
LOOP AT t_afko INTO l_wa_afko.
READ TABLE itab_date INTO l_wa_itab_date
WITH KEY aufnr = l_wa_afko-aufnr BINARY SEARCH.
IF sy-subrc NE 0.
l_wa_afko-rgekz = 'X'.
MODIFY t_afko FROM l_wa_afko TRANSPORTING rgekz.
ENDIF.
ENDLOOP.
DELETE t_afko WHERE rgekz = 'X'.
**MOD-006
-> initialize logical data base to reduce memory consumption
PERFORM ldb_process_init(sapdbioc)
CHANGING
lv_subrc.
--> add information to the order structure that is not
selected via logical database:
- if AFVO-entry is a phase (phflg) --> fill field for
corresponding operation number (PVZNR)
The internal node number (aplzl) of the corresponding operation
is in field PVZKN of the phase
- relationship information: E1AFABL
especially: select external numbers for the used
internal numbers in the table AFAB
- status information of the order header: E1JSTKL
- status information of the operation: E1JSTVL
--> Put matnr and ltrmi in the table t_afko
SORT t_afko BY aufnr.
LOOP AT help_afpo.
READ TABLE t_afko WITH KEY aufnr = help_afpo-aufnr
ASSIGNING -gltri = help_afpo-ltrmi.
ENDIF.
ENDLOOP.
--> Select entries for order and operation status
IF NOT t_objnr[] IS INITIAL.
SELECT objnr stat FROM jest INTO TABLE t_jest2
FOR ALL ENTRIES IN t_objnr
WHERE objnr = t_objnr-objnr
AND inact <> 'X'.
ENDIF.
--> Select entries for relationships from afab for all orders
into table t_afab_tmp
SORT t_aufpl_aplzl_vornr BY aufpl aplzl.
IF afab_x = cloi_x AND NOT t_aufpl_aufnr[] IS INITIAL.
-> select afab data
SELECT * FROM afab INTO TABLE t_afab_tmp
FOR ALL ENTRIES IN t_aufpl_aufnr
WHERE aufpl_vor = t_aufpl_aufnr-aufpl.
SELECT * FROM afab APPENDING TABLE t_afab_tmp
FOR ALL ENTRIES IN t_aufpl_aufnr
WHERE aufpl_nch = t_aufpl_aufnr-aufpl.
SORT t_afab_tmp
BY aufpl_vor aplzl_vor aufpl_nch aplzl_nch aobar mimax.
DELETE ADJACENT DUPLICATES FROM t_afab_tmp
COMPARING aufpl_vor aplzl_vor aufpl_nch aplzl_nch aobar mimax.
-> read external order numbers out of data base
CLEAR t_aufpl. REFRESH t_aufpl.
LOOP AT t_afab_tmp ASSIGNING -aufpl_nch.
COLLECT t_aufpl.
ENDLOOP.
CLEAR t_aufpl_aufnr. REFRESH t_aufpl_aufnr.
IF NOT t_aufpl[] IS INITIAL.
SELECT aufpl aufnr FROM afko INTO TABLE t_aufpl_aufnr
FOR ALL ENTRIES IN t_aufpl
WHERE aufpl = t_aufpl-aufpl.
SORT t_aufpl_aufnr BY aufpl.
ENDIF.
-> add order numbers to afab data
LOOP AT t_afab_tmp ASSIGNING -aufnr_nch = t_aufpl_aufnr-aufnr.
ENDIF.
ENDLOOP.
-> read operation numbers out of data base
CLEAR t_aufpl_aplzl. REFRESH t_aufpl_aplzl.
LOOP AT t_afab_tmp ASSIGNING -aplzl_nch.
COLLECT t_aufpl_aplzl.
ENDLOOP.
IF NOT t_aufpl_aplzl[] IS INITIAL.
SELECT aufpl aplzl vornr FROM afvc
APPENDING TABLE t_aufpl_aplzl_vornr
FOR ALL ENTRIES IN t_aufpl_aplzl
WHERE aufpl = t_aufpl_aplzl-aufpl
AND aplzl = t_aufpl_aplzl-aplzl.
SORT t_aufpl_aplzl_vornr BY aufpl aplzl.
ENDIF.
-> add operation numbers to afab data
LOOP AT t_afab_tmp ASSIGNING -vornr_nch = t_aufpl_aplzl_vornr-vornr.
ENDIF.
ENDLOOP.
ENDIF. "afab_x
--> fill AFAB (relationship information) and status information
SORT t_aufpl_aufnr BY aufnr.
LOOP AT t_afko ASSIGNING .
-> fill order head status information
IF jstk_x = cloi_x.
CLEAR t_jstk. REFRESH t_jstk.
LOOP AT t_jest2 INTO wa_tjest2 WHERE objnr = -t_jstk = t_jstk[].
ENDIF.
-> fill afab information
IF afab_x = cloi_x.
CLEAR t_aufpl_aufnr.
READ TABLE t_aufpl_aufnr WITH KEY
aufnr = -t_afab = t_afab[].
ENDIF.
-> fill operation and suboperation status information
IF jstv_x = cloi_x OR afvo_x = cloi_x.
LOOP AT .
-> read status information of suboperation
IF jstu_x = cloi_x.
LOOP AT -t_jstu = t_jstu[].
ENDLOOP.
ENDIF.
-> read status information of operation
IF jstv_x = cloi_x.
CLEAR t_jstv. REFRESH t_jstv.
LOOP AT t_jest2 INTO wa_tjest2 WHERE objnr = -t_jstv = t_jstv[].
ENDIF.
-> Read operation for a phase
IF NOT -pvznr = t_aufpl_aplzl_vornr-vornr.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
-> collect order numbers
CLEAR wa_aufnrdone.
wa_aufnrdone-low = -aufnr.
APPEND wa_aufnrdone TO lt_aufnrdone.
ENDLOOP.
-> append collected order numbers to global table
APPEND LINES OF lt_aufnrdone TO gt_aufnrdone.
EXPORT gt_aufnrdone TO MEMORY ID 'LOIAUFNRTAB'.
-> free large tables
CLEAR t_jest2. REFRESH t_jest2.
CLEAR t_afab_tmp. REFRESH t_afab_tmp.
CLEAR t_aufpl. REFRESH t_aufpl.
CLEAR t_aufpl_aufnr. REFRESH t_aufpl_aufnr.
CLEAR t_aufpl_aplzl. REFRESH t_aufpl_aplzl.
CLEAR t_aufpl_aplzl_vornr. REFRESH t_aufpl_aplzl_vornr.
-> create idocs
CALL FUNCTION 'CLOI_MASTERIDOC_CREATE_LOIPRO'
EXPORTING
opt_sys = opt_sys
message_type = mestyp
TABLES
order_data = t_afko
EXCEPTIONS
OTHERS = 1.
-> export already selected order numbers via ranges tab to memory
EXPORT t_aufnr_range_done TO MEMORY ID 'LOI002'.
**MOD-006
IMPORT created_masteridocs_pro FROM MEMORY ID 'YLOI001'.
ycloidownlprot-end_date = sy-datum.
ycloidownlprot-end_time = sy-uzeit.
ycloidownlprot-idocs_selected = created_masteridocs_pro.
ycloidownlprot-in_progress = cloi_false.
insert or update entry (dependant if entry already exists)
MODIFY ycloidownlprot.
COMMIT WORK.
MESSAGE i967(z001) WITH created_masteridocs_pro.
**MOD-006
Update last run date and time
IF p_update = 'X'.
PERFORM update_last_run.
ELSE.
MESSAGE s000 WITH text-022.
"Last Run Date and Last Run Time not updated
LEAVE LIST-PROCESSING.
ENDIF.
INCLUDE rcordf01.
*& Form validate_last_run_date_time
text
--> p1 text
<-- p2 text
*FORM validate_last_run_date_time.
IF p_date IS INITIAL OR
p_time IS INITIAL.
IF sy-batch IS INITIAL.
MESSAGE s000 WITH text-017.
"Last Run date & Last Run Time can not be blank
LEAVE LIST-PROCESSING.
ELSE.
MESSAGE e000 WITH text-017.
"Last Run date & Last Run Time can not be blank
ENDIF.
ENDIF.
*ENDFORM. " validate_last_run_date_time
*& Form update_last_run
text
--> p1 text
<-- p2 text
FORM update_last_run.
CONSTANTS:
l_c_name TYPE rvari_vnam VALUE 'Z_PROC_DATE',
l_c_name1 TYPE rvari_vnam VALUE 'Z_PROC_TIME',
l_c_type TYPE rsscr_kind VALUE 'P',
l_c_numb TYPE tvarv_numb VALUE '0000'.
Update last run date
UPDATE tvarv SET low = sy-datum
WHERE name = l_c_name AND
type = l_c_type AND
numb = l_c_numb.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
g_run_date = text-015. "#EC
"Updation of TVARV table failed for ZLAST_RUN_DATE. Update manually
ENDIF.
Update last run time
UPDATE tvarv SET low = sy-uzeit
WHERE name = l_c_name1 AND
type = l_c_type AND
numb = l_c_numb.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
g_run_time = text-016. "#EC
"Updation of TVARV table failed for ZLAST_RUN_TIME. Update manually
ENDIF.
ENDFORM. " update_last_run -
Update the "remark" field in general data of a BP (using IDOC in LSMW)
Hi,
I have to create and udpate BP with comments in the general data. I have no problem to manage this field in creation mode. I only use the segment "E101BAPIAD_REM" from the "CRMXIF_PARTNER_SAVE_M02" Idoc basic type. I fill the following fields: "LANGU, LANGU_ISO, ADR_NOTES".
However in update mode I don't success to update the value for the field "REMARK". I use the second segment "E101BAPIAD_REX" and i fill only field "ADR_NOTES" with value "X" and "UPDATEFLAG" with value "U".
I tried several value and several cases but i failed each time. If anybody has already managed this data with IDOC I would be very interesting...
regards,
Fabrice Mouyebe.Hi Thirumala,
thank you for your answer but you speak about the field "AddressGUID" of E101BUS_EI_ADDRESSREMARK but I haven't this field at this level. This field is linked to the segment "E101BUS_EI_BUPA_ADDRESS_KEY", isnt'it ?
Effectively i have certainly a problem with the Address GUID. I have to test it because it doesn't work with only UPDATEFLAG at 'X' and CURRENT_TASK too.
Thanks,
fabrice. -
Customer master creation using IDOC
Hi friends,
I am trying to create customer master into SAP using Idoc. Here pblm is some partner functions already defaulted i want to create some new entries in partner functions when i try to do it online its working fine when i try with idoc the defaulted partner functions are appears double times can any one has any idea whts happening.
E1KNVVM
E1KNVPM (Master customer master partner roles)
MSGFN : Function
PARVW : Partner function
KUNN2 : Customer number of business partner
DEFPA : Default partner
KNREF : Customer description of partner
PARZA : Partner counter
the pblm is with these segment.
Thanks,
Naren.Hi naren,
The segment E1KNVPM is standard one.Nothing can be done over it . U shold create new segments in we31 and add as
extension to the basic type and try..
Regards,
Nagaraj -
Creating sales order using IDOC - Delivery hour
Hi,
i've a problem to solve. when creating a sales order i need that when the segment is E1EDK03 and the IDDAT is 002 i need to extract the delivery hour and insert it in the table vbak-vzeit, now what i'm doing in the exit EXIT_SAPLVEDA_001 is:
DATA: hour LIKE vbak-vzeit.
CHECK segment-segnam = 'E1EDK03'.
IF segment-sdata(3) = '002'.
hour = segment-sdata+11(6).
ENDIF.
and now i want to acess the value in hour in the exit EXIT_SAPLVEDA_002 to put it in the dxvbak struct tha i think that is the table correct to then internaly fill the vbak. the problem is that the variable hour is not available in the exit EXIT_SAPLVEDA_002. i do i do to pass the value that i want from the exit EXIT_SAPLVEDA_001 to be available in exit EXIT_SAPLVEDA_002 and then insert that value in the right place to fill vbak.Can u tell me the steps to create a sales order using idoc, i've created a bapi but thats a temprory use. I wanted to created a sales order automatically when a purchase order is saved.
Please let me know if u can help me, i wanted to do it using idoc
Regards
Sanju -
XI IDOC missing segment definition in type E1LFM1M
Hi experts,
we have recently upgraded our ERP system to NW 702 EH5. As aresult a new segment definition was added to our segment type E1LFM1M ( segment def. E2LFM1M007). The problem we are havign is that our XI system is still running on NW700 and it doesnt have this segment defintion. Since the upgrade we are getting an error in transaction RFC complaining about the new segment definition E2LFM1M007 everytime we try to send a vendor from ERP to SUS using BD14. Is there a way we can deactivate the new segment definition E2LFM1M007 in segment type E1LFM1M?
Thanks,
Abdul.Hi Abdul,
Actually it does not matter what are your systems' versions, PI can always handle an IDoc properly. All you need to do is perform the following steps in your PI system:
1. Log on to ABAP stack, go to t-code idx2, find your ECC system and that particular IDoc (I believe this will be CREMAS) and delete its metadata.
2. Log on to Enterprise Services Repository, find your SWCV where the IDoc definition was loaded, and load it again from your ECC system, then activate the change.
3. If necessary, also adjust the message mapping to use/not use the new segment. Activate your changes.
Once you have these steps completed, you are ready to retest your scenario and say goodbye to the error.
Hope this helps,
Grzegorz -
Creating Conditions for Purchase Info Records using IDoc COND_A01
Hi All,
we are using IDOC COND_A01 to update and add conditions in ME12 transactions.
But when we send a condition IDoc which contains 2 condition types (Segment KONP), the standard function call creates only one database entry in the table KONP. The entry in KONP is for standard condition types PB00, but not for company specific types (Say: ZABC) .But when we create them manually in ME12 maintaining an purchase info record we get both the entries in the KONP database table.
Has anyone come accross such a problem? Is there any special field in the IDoc COND_A01 which controls the creation of the condition types?
Thanks for any answer!U should use basic type INFREC01 instead of NFRECMASS01.
Within the FM there is a check for basic type like:
check idoc type
if f_idoc_control-idoctp <> c_idoctp_infrec01. " INFREC01
raise wrong_function_called.
endif.
Edited by: Joyjit Ghosh on Sep 15, 2008 4:57 PM -
LSMW - Sales Order creation using IDoc
Hello,
I'm receiving a file containing different category of products and need to create a sales order (using IDoc or BAPI) per category. The input file contains UPC code, I use a SELECT statement to check the category and append the UPC code to the specific internal table .(one internal table per category). The issue I have is to do loop in all internal table and then to create a sales order. I have some difficulties to update item segment. Only one UPC is populated to the required segment. Please let me know if this could be done using LSMW.
Thanks ! Thanks ! Thanks ! Thanks !
MehdiYou can use program RVINVB10 ( Direct Input ) to create Sales Order , Before you run this program you will have to create a file with data in specific format.
Read the documenatation of the program.
LSMw can help in formatting the data but beetr write your own progarm to format data and then run above program as LSMW has limitations and I am not sure what type of file you are getting. In you custom program you will have more control.
Cheers.
Maybe you are looking for
-
Simple question about generate proxy
Hi guys... This is a simple but a truly simple question.... When trying to create a proxy from our messages interfaces using SPROXY, i'm not able to get the Software component versions that were used from the sld... Do I have to export them? Or impor
-
Any help? I am unable to change my settings because my iPad is not recognizing my Apple ID and password. Everything is correct,but I keep getting the message that an error occurred during activation. Try Again. Thank you!
-
Exchange rate in cost estimate(ck11n)
Hello All, Scenario: We have done cost estimate(ck11n) for material XYZ for September. The currency in info record is USD and the controlling area currency is EUR, now the old exchange rate from June has been picked up by the exchange rate type assig
-
Count of total number of rows, distinct count of column
Hi , I am looking for a procedure that will insert following data into columns : Table_name Column_name COUNT(*) , count(DISTINCT COL_NAME) EX: Employee emp_name 5000 4500 Employee emp_location 5000 10 I want this for the whole schema. I have a proce
-
Hi All, New GL is active, In FAGLL03, the entry date is blank for all the documents, i have to click on each documents and see the entry date of each. But it should show the entry date in FAGLL03 itself. Appreciate your quick response, Thank you, Vid