IDOC data transfer between 2 SAP Clients on same system
HI All,
i was transferring data through standard IDOC from table A609 in client 100(say) to client 301(say).
Sender u2013 100 (sender side)
Receiver u2013 301 (receiver side)
I did all configurations that were required for transferring data.
But at receiving side i.e. client 301, data is not populating in the table A609.
The status at sender side is:
status 03: Data Passed to port OK.
But the status is at the receiving side is:
status 64: IDOC ready to be transferred to application (yellow light)
My query is why the data is not getting populated in table at receiver end.
Waiting for your responses.......
Hi,
Instead of using idoc ..
You can write code in RFC function module and update the table directly.
If it is a Application i mean transaction back end many tables need to update on that case Idoc is necessary other wise use RFC preferabble,
Program RBDMANI2 for status 51 & 52
Program RBDAPP01 for status 64 ,66 "Run this Program By Passing Idoc number it will turn to Green and Table wil be updated
Program RBDAGAIE for status 32 and 69 (Edited IDocs)
Program RBDSYNER for status 26
Program RSEOUT00 for status 30
re-process IDocs failing in 29 status, use program RBDAGAIN.
transactions WEINBQUEUE and WEOUTQUEUE to control the individual queues
Regards,
Prabhuads
Similar Messages
-
Data transfer between SAP & Java and Vice versa using IDOC Process
Dear Experts,
We are working on one of the good requirement related to data transfer between SAP and Java software. Client requirement is, they want to transfer the data in both the ways (from SAP --> Java and Vice versa also).
In detail is, after sales order creation using one custom program loading plan details will be calculated. Once loading dates are confirmed then, user will release the sales document to transfer the data from SAP to Java using "Outbound IDOC processing". Similarly in that JAVA software some shipment details will be performed, once completed from JAVA software again details needs to be pumped back to SAP as "Inbound IDOC Processing".
For this fields are already identified from external software SAP and we are looking for the same to perform the steps in SAP.
At this stage, I need your expert opinion / feedback how to go about at this stage.
Meaning,
1. What are the customizing steps needs to be done in SAP..?
2. How to trigger the :Outbound IDOC process" once the documents are "Released" from custom transaction
3. How to create the link between SAP and JAVA to transfer the data between these 2 software
4. How to trigger the "Inbound IDOC Process" from JAVA software to SAP and how to store the data in SAP
Experts, please give your feedback in terms of reply or by sending the step by step process to fulfill this client requirement.
Thanks for your cooperation.
Regards,
RameshMaybe too many open questions in the same document.
Maybe you should repost a more specific question in a technical forum.
This looks like a small project where you already know what you want, maybe you should contract a technical specialist so he proceeds to the implementation! -
Vendor Master Data Transfer Between the Clients
Hello Everyone,
I want to transfer Vendor master data between the clients, can any one help me in this Please?
I don't want to use LSMW, Is there any other method by which i can copy the vendor between the clients or i have to do it manually?
Please Help ASAP
Thanks
MHi,
You have to do necessary setting for ALE and IDOC will get generated and data will get transfer based on the Program Schedule in Bacground.
You can schedule program in bacground as per your requirement of IDOC transfer and data generation from One Client to other. [i.e. end of the day, Hourly, monthly etc.]
Regards,
Manish -
Data transfer between C client and Java server
Hello there
I am working on a project where I have to develop a Client based on C and Server based on Java. The client can connect to Java server and it then sends a integer/string to Java server. But.. Java server unable to receive that and throws an IOException.
I use write method to send the integer buffer to the socket.
int out_buffer = 0;
int *pbuf;
pbuf = &out_buffer;
if (write(acskfd, pbuf, 4)< 0){
syslog(LOG_ERR,"Write failed. %s(%d)", strerror(errno), errno);
printf("\tCLIENT:\tWrite failed\n");
exit(1);
In Java, i use DatainputStream and readnInt method to read the integer from the stream.
cl_sock = socket_out.accept();
DataInputStream sInput =new DataInputStream(cl_sock.getInputStream()) ;
int cmd = sInput.readInt();
Am I missing someting.. Any suggestions would be really really helpful.
Thanks
Ithaca
PS: I running both programs in the same machine.
In C part, I also use host to network byte order conversion (serv_addr.sin_port = htons(portno).I would suggest writing a Java client to perform the same tasks as the C client.
Then if the Java client does, or does not work this can help dteremine which end is at fault.
Are you flushing your data from the client? -
Data transfer between SAP and SRM
Hi all,
I'm new with SRM and like from a help.
Working with SAP 4.7 and now with SRM 5.0, I need make the two systems if communicate.
I need send from SAP to SRM the master data, Material, Customer, Material Group, Cost Center.
I need send the shop car from SRM for create a PR in SAP.
I need send the documents RFQ, PO and Contract from SAP to SRM. For RFQ need receive in SAP the data of price updated by the customer.
How to make this conection? There are standard interface for these data? What are these interfaces?
Thanks,
Luciano LessaHello Ashutosh,
Thanks your help.
I have one question about replicate of the material master. In step by step say for complete the CRMSUBTAB table with following values:
User ObjectName U/D Obj. Class Function Obj. Type Funct. Name
CRM empty Download Material empty empty CRS_MATERIAL_EXTRACT
CRM empty Download Material empty empty CRS_CUSTOMIZING_EXTRACT
CRM empty Download Material empty empty CRS_SERVICE_EXTRACT
In our system is so:
User ObjectName U/D Obj. Class Function Obj. Type Funct. Name
CRM empty Download Material empty empty CRS_MATERIAL_EXTRACT
CRM empty Download CUSTOMIZING empty empty CRS_CUSTOMIZING_EXTRACT
CRM empty Download SERVICE_MASTER empty empty CRS_SERVICE_EXTRACT
This configuration is correct?
The field OBJ.CLASS is key of table, so not is possible add three like values.
Thanks,
Luciano Lessa -
Data transfer between EREC 606 and HR system EHP5
Hi All,
we have similar scenario to the discussions:
http://scn.sap.com/thread/3513535
http://scn.sap.com/thread/3513421
with that abbreviation that out system hosting partner has recommended EREC 606 as the right level. The main reason was as I recall that our SAP Portal is on the level 7.31.
As I see in that discussions others are using EREC 605 with ERP EHP5.
Our integration between ERP (HR) and EREC will be limited to transfer of job positions to be recruited. In our business model we have payroll outsourcer and the hired persons will be transferred from EREC via SAP PI to the outsourcer and then the outsourcer will send to us the file with new and changed employees and the SAP PI will read them into SAP HR.
1. are we going to make right landscape? We are now just about to install EREC 606 - will it work with ERP EHP5?
2. Second question is if we have to activate any business function in SAP HR (ERP)?
Cheers
WaldekDear Nicole,
thank you very much!
I like to double-check the question no 2:
- Indeed we have EREC 606 standalone (without ERP component)
- the SAP ERP system (including HR) EHP5 will communicate with EREC through ALE
Our hosting partner and application partner are now seriously considering if we need to activate on SAP ERP following BF's:
HCM_ASR_CI_1
HCM_MSS_ERC_CI_1
HCM_HIRE_INT_CI_1
Your answer means: NO - WE DO NOT NEED TO ACTIVATE THEM (?) -
IDOC data transfer SAP to Java using SAP JCo
Dear Experts,
The challenging requirement we are having is, we need to create the interface for data transfer between SAP system and the Java system. The data will be transferred from SAP to java and similarly once some processing done in Java again the details needs to be transferred from Java to SAP.
For this data transferred we are planning to use IDOC process and for interface "SAP Java connector" we are planning to use. In this case we are having some doubts.
1. The data from SAP is going to be transfered from one Custom transaction (Z tcode). Once "Outbound IDOC" will get triggered and will carry the details. Now the doubt is, whether the data / details will get transfered to JAVA system automatically or we need to perform any other steps from SAP ABAP coding...(like converting in to flat file, XML file and etc) ??
2. We are planning to install "SAP Jco" in Java server. Is this correct...??
3. Other than SAP Jco any other softwares needs to be installed or not..??
4. Since we are going to trigger the "outbound IDOC" from custom transaction, we are planning to develope one program in SE37. Other than this any other program we need to develop or not..??
If anybody has detailed steps or explanation please share it with us.
Warm Regards,
VELHi All,
For the above mentioned issue, we implemented JCo software in JAVA system and created the JAVA program including SAP logon credential details like Client, User name, password and Language details.
When this JAVA program was compiled successfully then, that non SAP system will appear in SAP gateway Tcode.
Once non SAP system started appearing in SAP gateway that means, both SAP & Non SAP are connected automatically.
Regards,
Velmurugan P -
OM and PA data transfer from SAP 4.7 to ECC 6.0
Dear Experts,
hi
i am working on one project where i will need to design the data transfer from SAP 4.7 to ECC 6.0. this is not a upgrade project.
the data of PA and OM are in 4.7 which is existing system. i need to transfer entire data into ECC 6.0 so i can use that data for my E-Recruitment module ( we are doing E-rec fresh implementation.)
we will keep both the systems (4.7 and ECC 6.0). ECC 6.0 will be used for E-Rec and OM only. for PA and Payroll we will use 4.7.
can some one tell me,
1. what are the key points to keep in consideration from OM point of view ?
2. which is the best method to transfer the OM structure and data from 4.7 to ECC?
3. what are the risks?
4. which system we should make master system and which will be the slave system? why ?
your input will be much appreciated.
thanks and regards
chandraHi Chandra,
I was under the impression that you are planning to use PA & OM from 4.7, now I read it again.
Now its advisable to keep ECC 6 as a master system, becoz OM is the stating point of the HR processes where all Orgnization unit, job, position exists. Later the same data can flow to the slave system for PA use. As OM is the starting point, this system should be the master system.
Abou the IDoc interface.
Check the basic type HRMS_A05, whether it has all the data you need to transmit. T-Code WE30
If you need to add something you can create a Z version in WE31. I selected HRMS_A05 as it is present in both the SAP version.
Next there are series of transaction you need to process. Check with technical person who hands IDoc interafcing.
Steps are:
Assigning Message type to IDOC Type with extension. T-Code WE82
Create Logical System:
T-Code SALE-> Basic Settings-> Logical Systems-> Define Logical System
It is required to configure in the sending system as well as in the receiving system
Assign Logical System to Client:
T-Code SALE-> Basic Settings-> Logical Systems-> Assign Logical System to Client
Create RFC Destinations:
T-Code SM59, select ABAP connection of type 3.
Create Distribution Model: T-Code BD64
Generate Partner Profile: T-Code BD82
Maintain sending system partner profile: T-Code WE20
Link Message Type to Function Module T-Code WE57 in receiving system only
Hope this will help.
Let me know if you need anything else.
BR/Manas -
Hi Experts,
I have few questions related to IDOC Data transfer. I have two different SAP Systems S1 and S2, S1 Creates sales order and send the data through IDOC Type ORDERS05 to S2, To create sales order in S1.
As i know, Program IDOC_INPUT_ORDERS is used for I/B IDocs in S2. Will be there be any programs to push the data from S1 System.
Thank you
Krishi,
idoc is not meant for sending files to another system, they are basically data containers which are sent to other systems like to send the data related to sales orders you can send idoc ORDERS.
you need to first be clear with the requirement for which business object you want to transfer the data, then need to look out if the Idoc is available for the same then only u can sent it.
for more info on idocs you can easily search on forums.
Reg,
NJ -
Communication between SAP and 3rd Party Systems using IDOC HTTP XML Interfa
Hi
i am try do
Communication between SAP and 3rd Party Systems using IDOC HTTP XML Interface
With The help of SDN Contribution
link----
( have look on it)
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4943f2b7-0a01-0010-37af-faff35b2f08c
I am getting error in
Partner system as HTTPLOG and "Execute" to check the results
Error is -- Port could not be created
RFC destination HTTPLOG Not specified for system HTTPLOG
any 1 have any idea if plzzzzzzzz...........
Thank u
RamHello .
we are also in process of implementing the same
could you share the knowledge pl?
1)is it a separate add on with ALE to saphr
or using ECC ??
2)can u share the configuration part ??
we are trying it on webas as addon 3.0 . -
Secure the file/data transfer between XI and any third-party system
Hi All,,
I would like to use to "secure" SSH on OS Level the file/data transfer between XI and any third-party system Run OS Command before processing and OS command After processing. right now my XI server installed on iSeries OS.
with ISeries we can't call the Unix commands hope we need to go for AS400 (CL) Programming. If we created the AS400 programm how i can call that in XI.
If any one have idea pls let me know weather it will work or not.
Thanks in adavance.
VenkatHi,
Thanks for your reply.
I have red some blogs like /people/krishna.moorthyp/blog/2007/07/31/sftp-vs-ftps-in-sap-pi to call the Unix Shell script in XI.
But as i know in iSeries OS we can write the shell script we need to go for AS400 programe. If we go with AS400 how we need to call that programe and it will work or not i am not sure there i need some help please.
Thanks,
Venkat -
Error 33172 occurred at Read & Write data transfer between two or more PF2010 controller
Hi,i need to do data transfer between two or more FP2010 controller.e.g. FP2010(A) & FP2010(B).
FP2010(A) need to transfer the measurement (from its I/O module) to FP2010(B) to do the data analysis.These data transfer should be synchronous btw two controller to prevent data lost.
From the vi used in the attachment,i encountered some problems at:
(1) Error 33172 occurred while publishing the data.Can i create and publish data under different item name?
(2) How to synchronies the read & write btw contorller?
All controller are communicating with each other directly without the need of a host computer to link them together
Is there any other method to do fast data transfer betwe
en controller?Hi YongNei,
You were succesful in omiting enough information to make it very difficult to answer!
Please post your example.
Please tell us what version of LV-RT you are using.
Please define what you concider "fast data transfer".
Have you concidered mapping the FP tags of FP2010(A) to FP2010(B) and vise versa?
WHat exactly has to be syncronized?
If you have something that is close to working, share that.
Well, that as far as I can go with the info you have provided. Depending on the details, what you are asking could be anything from trivial to impossible with the currently available technology. I just can't say.
It would probably be a good idea to start over with a fresh question (sorry) because not many people are going to know what a a "
PF2010" is and I can not guarentee that I will be able to get back to you personally until next week-end.
Trying to help you get an answer,
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
Data transfer from sap r/3 into excel sheet for mi01
hi gurus,
as i am a xi consultant i got requirement to write a program for data transfer from sap r/3 into excel sheet for MI01.can any body help me by giving sample code or example for this requirement.please help me.Hi Rohit,
This is an upload program and it has used both function modules to upload from an excel to R3 and to download from R3 onto excel.
GUI_UPLOAD
GUI_DOWNLOAD
are the function modules used.
Hope this helps,
*Output: Downloads error records onto presentation server,
* Displays report with number of success and error records
REPORT ZMCG047CONTR NO STANDARD PAGE HEADING
LINE-SIZE 255
MESSAGE-ID ZM.
*& Table declarations
TABLES : T001W, "Plants/Branches
T024E, "Purchasing Organizations
T001. "Company Codes
* TYPE-POOLS DECLARATION
TYPE-POOLS : SLIS.
* Types Declaration *
TYPES: BEGIN OF T_RECORD, "record storing contract info
LIFNR(010), "Vendor Number
EVART(004), "Agreement Type
EKORG(004), "Purchasing Organization
EKGRP(003), "Purchasing Group
WERKS(004), "Plant
LGORT(004), "Storage Location
KDATB(010), "Valid start Date
KDATE(010), "Valid End Date
ZTERM(004), "Payment Terms
KTWRT(020), "Target Value
EPSTP(001), "Item Category
EMATN(018), "Material Number
KTMNG(017), "Target Quantity
NETPR(014), "Net Price
PEINH(006), "Net Price Unit
BPRME(003), "Net Price Order Price Unit
IDNLF(035), "Vendor Material number
WEBRE(001), "GR Based-IV
MEPRF(001), "Pricing Date Category
LTEX1(040), "Info Text
DATAB(010), "Valid From
DATBI(010), "Valid To
KSCHL(004), "Condition Type
KBETR(016), "Condition Rate if scale is not given
KONWA(005), "Currency
KPEIN(005), "Condition Pricing Unit
KMEIN(003), "Condition Unit of Measure
KSTBM(019), "Scale
KBETR_01(016), "Scale Rate
DEL_FLAG, "Delete Flag Indicator
ERR_MSG(100), "Error Message
END OF T_RECORD,
BEGIN OF T_ERR_RECORD, "to have error records stored
LIFNR(010), "Vendor Number
EVART(004), "Agreement Type
EKORG(004), "Purchasing Organization
EKGRP(003), "Purchasing Group
WERKS(004), "Plant
LGORT(004), "Storage Location
KDATB(010), "Valid start Date
KDATE(010), "Valid End Date
ZTERM(004), "Payment Terms
KTWRT(020), "Target Value
EPSTP(001), "Item Category
EMATN(018), "Material Number
KTMNG(017), "Target Quantity
NETPR(014), "Net Price
PEINH(006), "Net Price Unit
BPRME(003), "Net Price Order Price Unit
IDNLF(035), "Vendor Material number
WEBRE(001), "GR Based-IV
MEPRF(001), "Pricing Date Category
LTEX1(040), "Info Text
DATAB(010), "Valid From
DATBI(010), "Valid To
KSCHL(004), "Condition Type
KBETR(016), "Condition Rate if scale is not given
KONWA(005), "Currency
KPEIN(005), "Condition Pricing Unit
KMEIN(003), "Condition Unit of Measure
KSTBM(019), "Scale
KBETR_01(016), "Scale Rate
DEL_FLAG, "Delete Flag Indicator
ERR_MSG(100), "Error Message
END OF T_ERR_RECORD,
BEGIN OF T_LOEKZ, "To have deletion indicators for materials
LOEKZ(001), "Deletion indicator in purchasing document
EMATN(018), "Material Number
WERKS(004), "Plant
LGORT(004), "Storage Location
BSTYP(001), "Purchasing document category
END OF T_LOEKZ,
BEGIN OF T_MATNR, " Type definition to store details of materials
MATNR(018), "Material Number
END OF T_MATNR,
BEGIN OF T_T001, " Type definition for company codes
BUKRS(004), " Company Code
END OF T_T001,
BEGIN OF T_ZMVXREF, "Cross-Reference table type
D_ALTKN(10), "Legacy Vendor Number
D_BUKRS(4), "Legacy Company Code
M_ALTKN(10), "SAP Company Code
END OF T_ZMVXREF,
BEGIN OF T_LFA1, "Master data of vendors
LIFNR(10), "Vendor Number
END OF T_LFA1,
* Type Declaration for T024E (Company Codes)
BEGIN OF T_T024E,
EKORG LIKE T024E-EKORG, "Purchasing organization
BUKRS LIKE T024E-BUKRS, "Company Code
END OF T_T024E,
* Type Declaration for t001w (Plant)
BEGIN OF T_T001W,
WERKS LIKE T001W-WERKS, "Plant
END OF T_T001W,
* Type Declatation for String Line
BEGIN OF T_STR1, "#EC NEEDED
SLINE(6000) TYPE C,
END OF T_STR1.
TYPES: BEGIN OF T_BDCDATA. "BDC Data
INCLUDE STRUCTURE BDCDATA.
TYPES: END OF T_BDCDATA.
* Internal Tables Declaration *
DATA:
* Internal table to store input file data
I_RECORD TYPE STANDARD TABLE OF T_RECORD INITIAL SIZE 0,
* Internal table to capture errors
I_ERR_REC TYPE STANDARD TABLE OF T_ERR_RECORD INITIAL SIZE 0,
* Internal table to check for deletion indicators
I_LOEKZ TYPE STANDARD TABLE OF T_LOEKZ INITIAL SIZE 0,
* Internal table to check for material numbers
I_MATNR TYPE STANDARD TABLE OF T_MATNR INITIAL SIZE 0,
* Internal table used for storing Cross-Reference data of Vendor
I_ZMVXREF TYPE STANDARD TABLE OF T_ZMVXREF INITIAL SIZE 0,
* Internal table for holding Vendor Numbers from Master table
I_LFA1 TYPE STANDARD TABLE OF T_LFA1 INITIAL SIZE 0,
* Internal table for holding Purchase Org and Company Codes
I_T024E TYPE STANDARD TABLE OF T_T024E INITIAL SIZE 0,
* Internal table for holding Plants
I_T001W TYPE STANDARD TABLE OF T_T001W INITIAL SIZE 0,
* Internal table for storing a list of Company Codes
I_T001 TYPE STANDARD TABLE OF T_T001 INITIAL SIZE 0,
* Internal table used for ALV Reporting
I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
* Internal table used for holding List Header
I_LISTHEADER TYPE SLIS_T_LISTHEADER, "EC NEEDED
* Internal table to hold ALV Event
I_ALV_EVENT TYPE SLIS_T_EVENT,
* Internal table to hold Sort Info for ALV Report
I_SORT TYPE SLIS_T_SORTINFO_ALV,
* Internal table for BDC Data
I_BDCDATA TYPE STANDARD TABLE OF T_BDCDATA INITIAL SIZE 0,
* Internal table for messages
I_MESSTAB TYPE TABLE OF BDCMSGCOLL,
* Internal table for String line
I_STR1 TYPE STANDARD TABLE OF T_STR1 INITIAL SIZE 0.
* Work Area Declaration *
DATA:
* Work Area to hold data for the Open Contract
WA_RECORD TYPE T_RECORD,
* Work Area to hold previous record data
WA_RECORDPREV TYPE T_RECORD,
* Work Area to hold errors
WA_ERR_REC TYPE T_ERR_RECORD,
* Work Area to hold the Deletion Indicator of materials
WA_LOEKZ TYPE T_LOEKZ,
* Work Area to hold Material numbers of required materials
WA_MATNR TYPE T_MATNR, "EC NEEDED
* Work Area to hold errors occured while performing BDC
WA_MESSTAB TYPE BDCMSGCOLL,
* Work Area to hold field catalog for ALV Reports
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
* Work Area to hold list header data for ALV reports
WA_LISTHEADER TYPE SLIS_LISTHEADER,
* Work Area to hold ALV Event
WA_ALV_EVENT LIKE LINE OF I_ALV_EVENT, "EC NEEDED
* Work Area to hold Layout of ALV Report
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
* Work Area to hold Cross-Reference data of Vendor
WA_ZMVXREF TYPE T_ZMVXREF,
* Work Area to hold Vendor Numbers from Master table
WA_LFA1 TYPE T_LFA1, "EC NEEDED
* Work Area to hold Purchase Org and Company Codes
WA_T024E TYPE T_T024E,
* Work Area to hold Company Codes
WA_T001 TYPE T_T001,
* Work Area to hold Plants
WA_T001W TYPE T_T001W,
* Work Area to hold Sort Info for ALV Report
WA_SORT TYPE SLIS_SORTINFO_ALV,
* Work Area to hold BDC Data
WA_BDCDATA TYPE T_BDCDATA,
* Work Area for String line
WA_STR1 TYPE T_STR1.
* Variables Declaration *
DATA: V_ERRMSG(500), "To temporarily store the error message
V_CONV_DATE(10) TYPE C, "To capture the converted date format
V_DATE LIKE SY-DATUM,
V_REPID LIKE SY-REPID, "holds report id
V_CROSS_REFERENCE_ERROR TYPE I, " cross-reference error
V_INPUTERROR_FLAG VALUE '', " input error status
V_FILENAME TYPE STRING, " File Name
VEN_FLAG(1), " at new status
MAT_FLAG(1), " at new status
V_IND(2) TYPE N, " index of table control
V_IND2(2) TYPE N, " index of table control
V_IND3(2) TYPE N, " index of table control
V_EVRTP1(20),
V_EPSTP1(20),
V_EMATN1(20),
V_KTMNG1(20),
V_NETPR1(20),
V_PEINH1(20),
V_BPRME1(20),
V_TCSELFLAG1(20),
V_KSCHL2(20),
V_KBETR2(20),
V_KONWA2(20),
V_KPEIN2(20),
V_KMEIN2(20),
V_SELKZ2(20),
V_KBETR3(20),
V_KSTBM3(20),
V_LINE TYPE I,
V_STR TYPE X VALUE '09',
V_EXIST TYPE C,
V_EXIST1 TYPE C,
V_ISDIR TYPE C,
V_ISDIR1 TYPE C.
* Constants Declaration *
CONSTANTS: C_TCODE(5) VALUE 'ME31K', "Trx code - Open Contract Creation
C_TRUE VALUE 'X', " Del_Flag indicator
C_LOEKZ_MARKED VALUE 'X', "Deletion indicator for material
C_INPUTERROR_FLAG_YES VALUE 'X', "Input File Indicator
C_VEN_ERR1 VALUE 1, "Error Indicator
C_16(2) VALUE '16',
C_VEN_ERR2 VALUE 2, "Error Indicator
C_VEN_ERR3 VALUE 3, "Error Indicator
C_VEN_SUCS VALUE 0, "Success Indicator
C_SUCCESS LIKE SY-SUBRC VALUE '0',
C_STRUE VALUE 'S', "Del_flag for SAP Errors
C_YTRUE VALUE 'Y', "Del_flag for Success Records
C_MSGTYP_E VALUE 'E', "holds error message type
C_MSGTYP_S VALUE 'S', "holds success message type
C_BSTYP VALUE 'K', "Purchasing Document type is Contract
C_BACKGROUND VALUE 'N', "Background mode
C_FOREGROUND VALUE 'A', "All Screen mode
C_ERRORS VALUE 'E', "Error screen mode
C_WK(2) VALUE 'WK'. "Value Contract
* Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-033.
SELECTION-SCREEN SKIP.
SELECT-OPTIONS:
* Plant
S_WERKS FOR T001W-WERKS OBLIGATORY,
* Purchase Organization
S_EKORG FOR T024E-EKORG OBLIGATORY.
* Company Code
PARAMETER P_BUKRS LIKE T001-BUKRS OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 3.
PARAMETER RB_SERVE RADIOBUTTON GROUP RBX DEFAULT 'X' USER-COMMAND U1.
SELECTION-SCREEN COMMENT 6(19) TEXT-036.
SELECTION-SCREEN POSITION 37.
PARAMETER RB_LOCAL RADIOBUTTON GROUP RBX.
SELECTION-SCREEN COMMENT 40(13) TEXT-035.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
PARAMETERS:
* Parameter holding Input File name
P_FILE LIKE RLGRAP-FILENAME
OBLIGATORY
LOWER CASE
DEFAULT 'C:\'
MODIF ID G1,
P_FILE1 LIKE RLGRAP-FILENAME
OBLIGATORY
LOWER CASE
DEFAULT '/celestica/interface/corp/in/work/'
MODIF ID G2,
* Parameter specifying Mode of calling the Transaction.
P_MODE DEFAULT 'N' OBLIGATORY,
* Check box used to test the input file.
P_TEST AS CHECKBOX DEFAULT 'X',
* Parameter holding Filename for holding Input File Errors
P_IPERR LIKE RLGRAP-FILENAME
OBLIGATORY
LOWER CASE
DEFAULT 'C:\'
MODIF ID G1,
P_IPERR1 LIKE RLGRAP-FILENAME
OBLIGATORY
LOWER CASE
DEFAULT '/celestica/interface/corp/in/work/047_Err.txt'
MODIF ID G2.
SELECTION-SCREEN END OF BLOCK B2.
* AT Selection Screen Events *
* Loop the screen to activate relative paths
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF RB_SERVE = C_TRUE AND SCREEN-GROUP1 = 'G1'.
SCREEN-OUTPUT = 0.
SCREEN-ACTIVE = 0.
SCREEN-INPUT = 0.
ELSEIF RB_LOCAL = C_TRUE AND SCREEN-GROUP1 = 'G2'.
SCREEN-OUTPUT = 0.
SCREEN-ACTIVE = 0.
SCREEN-INPUT = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN ON BLOCK B2.
* Checking Access Authorization for the user
CALL FUNCTION 'ZU_DATA_ACCESS_AUTH_CHECK'
EXPORTING
ACTVT = C_16
P_BUKRS = P_BUKRS
TABLES
S_WERKS = S_WERKS
S_EKORG = S_EKORG
EXCEPTIONS
BUKRS_FAILED = 1
VKORG_FAILED = 2
VTWEG_FAILED = 3
EKORG_FAILED = 4
WERKS_FAILED = 5
LGNUM_FAILED = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
AT SELECTION-SCREEN ON P_BUKRS.
IF NOT P_BUKRS IS INITIAL.
SELECT SINGLE BUKRS INTO T001
FROM T001
WHERE BUKRS EQ P_BUKRS.
IF SY-SUBRC NE 0.
MESSAGE I000 WITH TEXT-089.
STOP.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
* Search Help to select Input File path.
PERFORM GET_FILE_NAME USING P_FILE.
* Check for the existence of the file.
IF RB_LOCAL EQ C_TRUE.
CALL FUNCTION 'TMP_GUI_GET_FILE_EXIST'
EXPORTING
FNAME = P_FILE
IMPORTING
EXIST = V_EXIST
ISDIR = V_ISDIR
EXCEPTIONS
FILEINFO_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF V_ISDIR IS INITIAL.
IF V_EXIST IS INITIAL.
MESSAGE I000 WITH TEXT-018.
STOP.
ENDIF.
ELSEIF V_ISDIR EQ C_TRUE.
MESSAGE I000 WITH TEXT-068.
STOP.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_IPERR.
* Search Help to select Input Error File path.
PERFORM GET_FILE_NAME USING P_IPERR.
AT SELECTION-SCREEN.
* Validate Transaction Mode
IF P_MODE <> C_BACKGROUND AND
P_MODE <> C_FOREGROUND AND
P_MODE <> C_ERRORS.
MESSAGE I000 WITH TEXT-034.
STOP.
ENDIF.
START-OF-SELECTION.
* Get the Input File Data
V_FILENAME = P_FILE.
PERFORM UPLOAD_FLATFILE_DATA TABLES I_RECORD
USING V_FILENAME.
* Sorting the data by all fields
SORT I_RECORD.
* Ensuring the padding of the empty spaces before the vendor No
CLEAR WA_RECORD.
LOOP AT I_RECORD INTO WA_RECORD.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_RECORD-LIFNR
IMPORTING
OUTPUT = WA_RECORD-LIFNR.
MODIFY I_RECORD FROM WA_RECORD
INDEX SY-TABIX
TRANSPORTING LIFNR.
CLEAR WA_RECORD.
ENDLOOP.
* Input file validation
PERFORM VALIDATE_FLATFILE_DATA.
IF P_TEST = C_TRUE.
IF I_ERR_REC[] IS INITIAL.
MESSAGE I000 WITH TEXT-032.
STOP.
ELSE.
* Display all the error records at the input level.
PERFORM DISPLAY_INPERR_RECORDS.
* Download Error File
PERFORM DOWNLOAD_ERROR_FILE.
ENDIF.
ELSE.
* Build BDC Data
PERFORM BUILD_BDC_DATA.
* Download Error File
PERFORM DOWNLOAD_ERROR_FILE.
* Display the status report.
PERFORM DISPLAY_PROCESSED_RECORDS.
ENDIF.
END-OF-SELECTION.
REFRESH: I_RECORD,
I_ERR_REC,
I_LOEKZ,
I_MATNR,
I_ZMVXREF,
I_LFA1,
I_T024E,
I_FIELDCAT,
I_LISTHEADER,
I_ALV_EVENT,
I_SORT,
I_BDCDATA,
I_MESSTAB,
I_STR1.
FREE: I_RECORD,
I_ERR_REC,
I_LOEKZ,
I_MATNR,
I_ZMVXREF,
I_LFA1,
I_T024E,
I_FIELDCAT,
I_LISTHEADER,
I_ALV_EVENT,
I_SORT,
I_BDCDATA,
I_MESSTAB,
I_STR1.
*& Form GET_file_name
* Fetches the file and path from the presentation system
* --> p1 Path along with the file name
FORM GET_FILE_NAME USING L_FILE LIKE RLGRAP-FILENAME.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
MASK = ',*.TXT,*.txt.'
MODE = 'O'
TITLE = TEXT-011
IMPORTING
FILENAME = L_FILE
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
CASE SY-SUBRC.
WHEN 1.
MESSAGE I000 WITH TEXT-084.
STOP.
WHEN 2.
MESSAGE I000 WITH TEXT-085.
STOP.
WHEN 3.
MESSAGE I000 WITH TEXT-086.
STOP.
WHEN 4.
MESSAGE I000 WITH TEXT-087.
STOP.
ENDCASE.
ENDFORM. " GET_file_name
*& Form upload_flatfile_data
* Uploading data from Flat File
FORM UPLOAD_FLATFILE_DATA
TABLES I_L_RECORD STRUCTURE WA_RECORD
USING L_FILENAME TYPE STRING.
DATA WA_L_RECORD TYPE T_RECORD.
* Upload the Flat file data
IF RB_LOCAL EQ C_TRUE. "File is on the Local System
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = I_L_RECORD
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
CASE SY-SUBRC.
WHEN 0.
DESCRIBE TABLE I_L_RECORD LINES V_LINE.
IF V_LINE EQ 0.
MESSAGE I000 WITH TEXT-065.
STOP.
ENDIF.
WHEN 1.
MESSAGE I000 WITH TEXT-068.
STOP.
WHEN 2.
MESSAGE I000 WITH TEXT-069.
STOP.
WHEN 3.
MESSAGE I000 WITH TEXT-070.
STOP.
WHEN 4.
MESSAGE I000 WITH TEXT-071.
STOP.
WHEN 5.
MESSAGE I000 WITH TEXT-072.
STOP.
WHEN 6.
MESSAGE I000 WITH TEXT-073.
STOP.
WHEN 7.
MESSAGE I000 WITH TEXT-074.
STOP.
WHEN 8.
MESSAGE I000 WITH TEXT-075.
STOP.
WHEN 9.
MESSAGE I000 WITH TEXT-076.
STOP.
WHEN 10.
MESSAGE I000 WITH TEXT-077.
STOP.
WHEN 11.
MESSAGE I000 WITH TEXT-078.
STOP.
WHEN 12.
MESSAGE I000 WITH TEXT-079.
STOP.
WHEN 13.
MESSAGE I000 WITH TEXT-080.
STOP.
WHEN 14.
MESSAGE I000 WITH TEXT-081.
STOP.
WHEN 15.
MESSAGE I000 WITH TEXT-082.
STOP.
WHEN 16.
MESSAGE I000 WITH TEXT-083.
STOP.
ENDCASE.
CLEAR V_LINE.
ELSEIF RB_SERVE EQ C_TRUE. "File is on the Application Server
P_MODE = C_BACKGROUND.
OPEN DATASET P_FILE1 FOR INPUT IN TEXT MODE.
CHECK SY-SUBRC EQ C_SUCCESS.
CLEAR WA_STR1.
DO.
READ DATASET P_FILE1 INTO WA_STR1.
IF SY-SUBRC <> 0. " NE SUCCESS.
EXIT.
ELSEIF SY-SUBRC EQ C_SUCCESS.
APPEND WA_STR1 TO I_STR1.
CLEAR WA_STR1.
ENDIF. " ENDIF on SY-SUBRC 0 Check.
ENDDO. " ENDDO
DELETE I_STR1 WHERE SLINE EQ ' '.
DESCRIBE TABLE I_STR1 LINES V_LINE.
IF V_LINE EQ 0.
MESSAGE S000 WITH TEXT-065.
STOP.
ENDIF.
LOOP AT I_STR1 INTO WA_STR1.
CLEAR: WA_L_RECORD.
SPLIT WA_STR1-SLINE AT V_STR
INTO WA_L_RECORD-LIFNR
WA_L_RECORD-EVART
WA_L_RECORD-EKORG
WA_L_RECORD-EKGRP
WA_L_RECORD-WERKS
WA_L_RECORD-LGORT
WA_L_RECORD-KDATB
WA_L_RECORD-KDATE
WA_L_RECORD-ZTERM
WA_L_RECORD-KTWRT
WA_L_RECORD-EPSTP
WA_L_RECORD-EMATN
WA_L_RECORD-KTMNG
WA_L_RECORD-NETPR
WA_L_RECORD-PEINH
WA_L_RECORD-BPRME
WA_L_RECORD-IDNLF
WA_L_RECORD-WEBRE
WA_L_RECORD-MEPRF
WA_L_RECORD-LTEX1
WA_L_RECORD-DATAB
WA_L_RECORD-DATBI
WA_L_RECORD-KSCHL
WA_L_RECORD-KBETR
WA_L_RECORD-KONWA
WA_L_RECORD-KPEIN
WA_L_RECORD-KMEIN
WA_L_RECORD-KSTBM
WA_L_RECORD-KBETR_01
WA_L_RECORD-DEL_FLAG
WA_L_RECORD-ERR_MSG.
APPEND WA_L_RECORD TO I_L_RECORD.
CLEAR: WA_L_RECORD,
WA_STR1.
ENDLOOP.
REFRESH I_STR1.
CLOSE DATASET P_FILE1.
ENDIF.
ENDFORM.
*& Form BDC_DYNPRO
* Data populated into i_bdcdata table for program
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR WA_BDCDATA.
WA_BDCDATA-PROGRAM = PROGRAM.
WA_BDCDATA-DYNPRO = DYNPRO.
WA_BDCDATA-DYNBEGIN = C_TRUE.
APPEND WA_BDCDATA TO I_BDCDATA.
ENDFORM.
*& Form BDC_FIELD
* Data populated into i_bdcdata table for fields
FORM BDC_FIELD USING FNAM FVAL.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO I_BDCDATA.
ENDFORM.
*& Form convert_date
* Converting the data from the file format to mm/dd/yyyy format
* <--P_wa_record_kdatb Source Date
* <--p_l_conv_date Target Date
FORM CONVERT_DATE USING L_DATE
L_TAR_DATE.
CONCATENATE L_DATE+0(2)
L_DATE+3(2)
L_DATE+6(4)
INTO L_TAR_DATE.
ENDFORM. " convert_date
*& Form validate_flatfile_data
* Validating the input file
FORM VALIDATE_FLATFILE_DATA.
DATA: L_TODAY LIKE SY-DATUM,
L_STARTDATE_C LIKE SY-DATUM,
L_ENDDATE_C LIKE SY-DATUM,
L_ENDDATE_C1 LIKE SY-DATUM,
L_STARTDATE_C1 LIKE SY-DATUM,
L_STARTDATE(8),
L_ENDDATE(8).
* Fetch indicator for all records on the material, plant & storage
* location combination.
IF NOT I_RECORD[] IS INITIAL.
REFRESH I_LOEKZ.
SELECT EMATN " Material Number
WERKS " Plant
LGORT " Storage Location
BSTYP " Purchasing Document Category
LOEKZ " Deletion indicator
INTO TABLE I_LOEKZ
FROM EKPO
FOR ALL ENTRIES IN I_RECORD
WHERE EMATN = I_RECORD-EMATN
AND WERKS = I_RECORD-WERKS
AND LGORT = I_RECORD-LGORT
AND BSTYP = C_BSTYP
AND LOEKZ = C_LOEKZ_MARKED.
IF SY-SUBRC EQ 0.
SORT I_LOEKZ BY EMATN WERKS LGORT BSTYP LOEKZ.
ENDIF.
* Fetching Plants for all entries in the selection screen
REFRESH I_T001W.
SELECT WERKS "Plant
INTO TABLE I_T001W
FROM T001W
WHERE WERKS IN S_WERKS.
IF SY-SUBRC EQ 0.
SORT I_T001W BY WERKS.
ENDIF.
* Fetching materials for the plants listed in flat file
REFRESH I_MATNR.
SELECT MATNR " Material Number
INTO TABLE I_MATNR
FROM MARC
FOR ALL ENTRIES IN I_RECORD
WHERE WERKS = I_RECORD-WERKS.
IF SY-SUBRC EQ 0.
SORT I_MATNR BY MATNR.
ENDIF.
* Fetching Company Codes for repective Purchase Organizations
REFRESH I_T024E.
SELECT EKORG " Purchase Organization
BUKRS " Company Code
INTO TABLE I_T024E
FROM T024E
WHERE EKORG IN S_EKORG.
IF SY-SUBRC EQ 0.
SORT I_T024E BY EKORG.
ENDIF.
* Fetching SAP Data using Legacy Data.
REFRESH I_ZMVXREF.
SELECT D_ALTKN
D_BUKRS
M_ALTKN
INTO TABLE I_ZMVXREF
FROM ZMVXREF
FOR ALL ENTRIES IN I_RECORD
WHERE D_ALTKN = I_RECORD-LIFNR.
IF SY-SUBRC EQ 0.
SORT I_ZMVXREF BY D_ALTKN D_BUKRS.
ENDIF.
* Fetching Vendors from LFA1
IF NOT I_ZMVXREF[] IS INITIAL.
REFRESH I_LFA1.
SELECT LIFNR
INTO TABLE I_LFA1
FROM LFA1
FOR ALL ENTRIES IN I_ZMVXREF
WHERE LIFNR = I_ZMVXREF-M_ALTKN.
IF SY-SUBRC EQ 0.
SORT I_LFA1 BY LIFNR.
ENDIF.
ENDIF.
* Start Validating the flat file
CLEAR: WA_RECORD,
WA_T024E,
WA_ZMVXREF,
WA_LFA1,
WA_LOEKZ,
WA_MATNR.
LOOP AT I_RECORD INTO WA_RECORD.
L_TODAY = SY-DATUM.
L_STARTDATE = WA_RECORD-KDATB.
L_ENDDATE = WA_RECORD-KDATE.
IF WA_RECORD-DEL_FLAG IS INITIAL.
READ TABLE I_T001W INTO WA_T001W
WITH KEY WERKS = WA_RECORD-WERKS
BINARY SEARCH.
IF SY-SUBRC EQ 0.
* Cross-Reference check performed for the given Vendors
READ TABLE I_T024E INTO WA_T024E
WITH KEY EKORG = WA_RECORD-EKORG
BINARY SEARCH.
IF SY-SUBRC NE 0.
V_CROSS_REFERENCE_ERROR = C_VEN_ERR3.
ELSE.
READ TABLE I_ZMVXREF INTO WA_ZMVXREF
WITH KEY D_ALTKN = WA_RECORD-LIFNR
D_BUKRS = P_BUKRS
BINARY SEARCH.
IF SY-SUBRC EQ 0.
READ TABLE I_LFA1 INTO WA_LFA1
WITH KEY LIFNR = WA_ZMVXREF-M_ALTKN
BINARY SEARCH.
IF SY-SUBRC EQ 0.
V_CROSS_REFERENCE_ERROR = C_VEN_SUCS.
ELSE.
V_CROSS_REFERENCE_ERROR = C_VEN_ERR2.
ENDIF.
ELSE.
V_CROSS_REFERENCE_ERROR = C_VEN_ERR1.
ENDIF.
ENDIF.
* Legacy Vendor could not be mapped
IF V_CROSS_REFERENCE_ERROR EQ C_VEN_ERR1.
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES. "Inp.file err. occurd
WA_RECORD-DEL_FLAG = C_TRUE.
WA_RECORD-ERR_MSG = TEXT-007.
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE LIFNR = WA_RECORD-LIFNR.
* Legacy Vendor is mapped but the obtained SAP vendor doesn't exist.
ELSEIF V_CROSS_REFERENCE_ERROR EQ C_VEN_ERR2.
* Inp.file err. occurd
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES.
WA_RECORD-DEL_FLAG = C_TRUE.
WA_RECORD-ERR_MSG = TEXT-008.
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE LIFNR = WA_RECORD-LIFNR.
* Purchase Organization doesn't exist in T024E.
ELSEIF V_CROSS_REFERENCE_ERROR EQ C_VEN_ERR3.
* Inp.file err. occurd
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES.
WA_RECORD-DEL_FLAG = C_TRUE.
WA_RECORD-ERR_MSG = TEXT-014.
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE EKORG = WA_RECORD-EKORG.
* Vendor is mapped and validated successfully
ELSEIF V_CROSS_REFERENCE_ERROR EQ C_VEN_SUCS.
* Checking for the deletion indicator for that record
CONCATENATE WA_RECORD-KDATB+6(4)
WA_RECORD-KDATB+3(2)
WA_RECORD-KDATB+0(2)
INTO
L_STARTDATE.
MOVE L_STARTDATE TO L_STARTDATE_C.
CONCATENATE WA_RECORD-KDATB+6(4)
WA_RECORD-KDATB+0(2)
WA_RECORD-KDATB+3(2)
INTO
L_STARTDATE_C1.
CONCATENATE WA_RECORD-KDATE+6(4)
WA_RECORD-KDATE+3(2)
WA_RECORD-KDATE+0(2)
INTO
L_ENDDATE.
MOVE L_ENDDATE TO L_ENDDATE_C.
CONCATENATE WA_RECORD-KDATE+6(4)
WA_RECORD-KDATE+0(2)
WA_RECORD-KDATE+3(2)
INTO
L_ENDDATE_C1.
READ TABLE I_LOEKZ INTO WA_LOEKZ WITH KEY
EMATN = WA_RECORD-EMATN
WERKS = WA_RECORD-WERKS
LGORT = WA_RECORD-LGORT
BINARY SEARCH.
IF SY-SUBRC EQ 0.
* Inpfle err.occured
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES.
WA_RECORD-ERR_MSG = TEXT-003.
WA_RECORD-DEL_FLAG = C_TRUE. "marking the record
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE LIFNR = WA_RECORD-LIFNR
AND EVART = WA_RECORD-EVART
AND EKORG = WA_RECORD-EKORG
AND EKGRP = WA_RECORD-EKGRP
AND WERKS = WA_RECORD-WERKS
AND LGORT = WA_RECORD-LGORT
AND KDATB = WA_RECORD-KDATB
AND KDATE = WA_RECORD-KDATE
AND ZTERM = WA_RECORD-ZTERM
AND KTWRT = WA_RECORD-KTWRT
AND EPSTP = WA_RECORD-EPSTP
AND EMATN = WA_RECORD-EMATN.
* Validating the Purchasing Organization for Blank/Null
ELSEIF WA_RECORD-EKORG IS INITIAL.
* Inpfle err.occured
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES.
WA_RECORD-ERR_MSG = TEXT-010.
WA_RECORD-DEL_FLAG = C_TRUE.
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE LIFNR = WA_RECORD-LIFNR
AND EVART = WA_RECORD-EVART
AND EKORG = WA_RECORD-EKORG
AND EKGRP = WA_RECORD-EKGRP
AND WERKS = WA_RECORD-WERKS
AND LGORT = WA_RECORD-LGORT
AND KDATB = WA_RECORD-KDATB
AND KDATE = WA_RECORD-KDATE
AND ZTERM = WA_RECORD-ZTERM
AND KTWRT = WA_RECORD-KTWRT
AND EPSTP = WA_RECORD-EPSTP
AND EMATN = WA_RECORD-EMATN.
* Validating the Plant for Blank/Null
ELSEIF WA_RECORD-WERKS IS INITIAL.
* Inpfle err.occured
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES.
WA_RECORD-ERR_MSG = TEXT-039.
WA_RECORD-DEL_FLAG = C_TRUE.
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE LIFNR = WA_RECORD-LIFNR
AND EVART = WA_RECORD-EVART
AND EKORG = WA_RECORD-EKORG
AND EKGRP = WA_RECORD-EKGRP
AND WERKS = WA_RECORD-WERKS
AND LGORT = WA_RECORD-LGORT
AND KDATB = WA_RECORD-KDATB
AND KDATE = WA_RECORD-KDATE
AND ZTERM = WA_RECORD-ZTERM
AND KTWRT = WA_RECORD-KTWRT
AND EPSTP = WA_RECORD-EPSTP
AND EMATN = WA_RECORD-EMATN.
* Validating the Contract Validity Start Date
ELSEIF L_STARTDATE_C1 GT L_TODAY. "#EC PORTABLE
* Inpfle err.occured
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES.
WA_RECORD-ERR_MSG = TEXT-004.
WA_RECORD-DEL_FLAG = C_TRUE. "marking the record
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE LIFNR = WA_RECORD-LIFNR
AND EVART = WA_RECORD-EVART
AND EKORG = WA_RECORD-EKORG
AND EKGRP = WA_RECORD-EKGRP
AND WERKS = WA_RECORD-WERKS
AND LGORT = WA_RECORD-LGORT
AND KDATB = WA_RECORD-KDATB.
* Validating the Contract Validity End Date
ELSEIF L_ENDDATE_C1 LE L_TODAY. "#EC PORTABLE
* Inpfle err.ocrd
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES.
WA_RECORD-ERR_MSG = TEXT-005.
WA_RECORD-DEL_FLAG = C_TRUE. "marking the record
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE LIFNR = WA_RECORD-LIFNR
AND EVART = WA_RECORD-EVART
AND EKORG = WA_RECORD-EKORG
AND EKGRP = WA_RECORD-EKGRP
AND WERKS = WA_RECORD-WERKS
AND LGORT = WA_RECORD-LGORT
AND KDATB = WA_RECORD-KDATB
AND KDATE = WA_RECORD-KDATE.
* Checking for Material under the Plant for Agreement Type 'WK'
ELSEIF WA_RECORD-EVART = C_WK.
READ TABLE I_MATNR INTO WA_MATNR
WITH KEY MATNR = WA_RECORD-EMATN
BINARY SEARCH.
IF SY-SUBRC NE 0.
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES. "Inpfle err.ocrd
WA_RECORD-ERR_MSG = TEXT-006.
WA_RECORD-DEL_FLAG = C_TRUE. "marking the record
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE LIFNR = WA_RECORD-LIFNR
AND EVART = WA_RECORD-EVART
AND EKORG = WA_RECORD-EKORG
AND EKGRP = WA_RECORD-EKGRP
AND WERKS = WA_RECORD-WERKS
AND LGORT = WA_RECORD-LGORT
AND KDATB = WA_RECORD-KDATB
AND KDATE = WA_RECORD-KDATE
AND ZTERM = WA_RECORD-ZTERM
AND KTWRT = WA_RECORD-KTWRT
AND EPSTP = WA_RECORD-EPSTP
AND EMATN = WA_RECORD-EMATN.
ENDIF.
ENDIF. " checking of deletion indicator
ENDIF. " checking for success of vendor cross reference
ELSE.
V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES. "Inpfle err.ocrd
WA_RECORD-ERR_MSG = TEXT-041.
WA_RECORD-DEL_FLAG = C_TRUE. "marking the record
MODIFY I_RECORD FROM WA_RECORD
TRANSPORTING DEL_FLAG
ERR_MSG
WHERE WERKS = WA_RECORD-WERKS.
ENDIF. " Plant checked to selection screen
ENDIF. " the records for which del_flag is initial
CLEAR: WA_RECORD,
WA_T024E,
WA_ZMVXREF,
WA_LFA1,
WA_LOEKZ,
WA_MATNR,
L_TODAY,
L_STARTDATE_C,
L_ENDDATE_C,
L_STARTDATE,
L_ENDDATE.
ENDLOOP.
LOOP AT I_RECORD INTO WA_RECORD.
IF WA_RECORD-DEL_FLAG = C_TRUE.
APPEND WA_RECORD TO I_ERR_REC.
CLEAR WA_RECORD.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE E000 WITH TEXT-013. " no records in the flat file
STOP.
ENDIF.
ENDFORM. " validate_flatfile_data
*& Form DOWNLOAD_ERROR_FILE
* Downloads all records along with the records encountering the
* input file validation error
FORM DOWNLOAD_ERROR_FILE.
DATA L_ISDIR TYPE C.
IF V_INPUTERROR_FLAG = C_INPUTERROR_FLAG_YES.
V_FILENAME = P_IPERR.
* Check for the existence of the file.
IF RB_LOCAL EQ C_TRUE.
CALL FUNCTION 'TMP_GUI_GET_FILE_EXIST'
EXPORTING
FNAME = P_IPERR
IMPORTING
ISDIR = L_ISDIR
EXCEPTIONS
FILEINFO_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF L_ISDIR EQ C_TRUE.
MESSAGE I000 WITH TEXT-088.
STOP.
ENDIF.
ENDIF.
IF RB_LOCAL EQ C_TRUE.
* Download the Input Error File.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = V_FILENAME
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = '#'
TABLES
DATA_TAB = I_ERR_REC
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSEIF RB_SERVE EQ C_TRUE.
OPEN DATASET P_IPERR1 FOR OUTPUT IN TEXT MODE.
CHECK SY-SUBRC EQ 0.
CLEAR WA_ERR_REC.
LOOP AT I_ERR_REC INTO WA_ERR_REC.
IF WA_ERR_REC-DEL_FLAG = C_TRUE.
TRANSFER WA_ERR_REC TO P_IPERR1.
ENDIF.
CLEAR WA_ERR_REC.
ENDLOOP.
CLOSE DATASET P_IPERR1.
ENDIF.
ENDIF.
ENDFORM. " DOWNLOAD_ERROR_FILE
*& Form BUILD_BDC_DATA
* Populates BDC for all the fields neccessary for Open Contract Creation
FORM BUILD_BDC_DATA.
DATA: L_MAT_INDEX TYPE I,
L_CON_INDEX TYPE I,
L_SCA_INDEX TYPE I.
CLEAR WA_BDCDATA.
REFRESH: I_BDCDATA,
I_MESSTAB.
* Processing the bdc
CLEAR: WA_RECORD,
WA_RECORDPREV,
VEN_FLAG,
MAT_FLAG.
LOOP AT I_RECORD INTO WA_RECORD.
* Checks for the del_flag of the record.
IF WA_RECORD-DEL_FLAG EQ C_TRUE
OR WA_RECORD-DEL_FLAG EQ C_STRUE.
CLEAR WA_RECORD.
CONTINUE.
ELSE.
IF WA_RECORDPREV-LIFNR NE WA_RECORD-LIFNR
OR WA_RECORDPREV-EVART NE WA_RECORD-EVART
OR WA_RECORDPREV-EKORG NE WA_RECORD-EKORG
OR WA_RECORDPREV-EKGRP NE WA_RECORD-EKGRP
OR WA_RECORDPREV-WERKS NE WA_RECORD-WERKS
OR WA_RECORDPREV-LGORT NE WA_RECORD-LGORT
OR WA_RECORDPREV-KDATB NE WA_RECORD-KDATB
OR WA_RECORDPREV-KDATE NE WA_RECORD-KDATE
OR WA_RECORDPREV-ZTERM NE WA_RECORD-ZTERM
OR WA_RECORDPREV-KTWRT NE WA_RECORD-KTWRT.
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RM06E-LGORT'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
* Cross-Reference check performed for the given Vendors
CLEAR WA_T024E.
READ TABLE I_T024E INTO WA_T024E
WITH KEY EKORG = WA_RECORD-EKORG
BINARY SEARCH.
IF SY-SUBRC EQ 0.
CLEAR WA_ZMVXREF.
READ TABLE I_ZMVXREF INTO WA_ZMVXREF
WITH KEY D_ALTKN = WA_RECORD-LIFNR
D_BUKRS = P_BUKRS
BINARY SEARCH.
IF SY-SUBRC EQ 0.
PERFORM BDC_FIELD USING 'EKKO-LIFNR'
WA_ZMVXREF-M_ALTKN.
ENDIF.
CLEAR WA_ZMVXREF.
ENDIF.
CLEAR WA_T024E.
PERFORM BDC_FIELD USING 'RM06E-EVART'
WA_RECORD-EVART.
PERFORM BDC_FIELD USING 'EKKO-EKORG'
WA_RECORD-EKORG.
PERFORM BDC_FIELD USING 'EKKO-EKGRP'
WA_RECORD-EKGRP.
PERFORM BDC_FIELD USING 'RM06E-WERKS'
WA_RECORD-WERKS.
PERFORM BDC_FIELD USING 'RM06E-LGORT'
WA_RECORD-LGORT.
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0201'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'EKKO-KTWRT'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=AB'.
PERFORM CONVERT_DATE USING WA_RECORD-KDATB V_CONV_DATE.
PERFORM BDC_FIELD USING 'EKKO-KDATB'
V_CONV_DATE.
PERFORM CONVERT_DATE USING WA_RECORD-KDATE V_CONV_DATE.
PERFORM BDC_FIELD USING 'EKKO-KDATE'
V_CONV_DATE.
PERFORM BDC_FIELD USING 'EKKO-ZTERM'
WA_RECORD-ZTERM.
PERFORM BDC_FIELD USING 'EKKO-KTWRT'
WA_RECORD-KTWRT.
VEN_FLAG = 1.
L_MAT_INDEX = 1. "index for table-control of material
ENDIF.
* "first check for itemline
IF WA_RECORDPREV-EPSTP NE WA_RECORD-EPSTP
OR WA_RECORDPREV-EMATN NE WA_RECORD-EMATN
OR WA_RECORDPREV-KTMNG NE WA_RECORD-KTMNG
OR WA_RECORDPREV-NETPR NE WA_RECORD-NETPR
OR WA_RECORDPREV-PEINH NE WA_RECORD-PEINH
OR WA_RECORDPREV-BPRME NE WA_RECORD-BPRME
OR WA_RECORDPREV-IDNLF NE WA_RECORD-IDNLF
OR WA_RECORDPREV-WEBRE NE WA_RECORD-WEBRE
OR WA_RECORDPREV-MEPRF NE WA_RECORD-MEPRF
OR WA_RECORDPREV-LTEX1 NE WA_RECORD-LTEX1
OR VEN_FLAG EQ 1.
V_IND = L_MAT_INDEX.
IF V_IND GT 1.
V_IND = 2.
ENDIF.
CONCATENATE 'RM06E-EVRTP(' V_IND ')' INTO V_EVRTP1.
CONCATENATE 'RM06E-EPSTP(' V_IND ')' INTO V_EPSTP1.
CONCATENATE 'EKPO-EMATN(' V_IND ')' INTO V_EMATN1.
CONCATENATE 'EKPO-KTMNG(' V_IND ')' INTO V_KTMNG1.
CONCATENATE 'EKPO-NETPR(' V_IND ')' INTO V_NETPR1.
CONCATENATE 'EKPO-PEINH(' V_IND ')' INTO V_PEINH1.
CONCATENATE 'EKPO-BPRME(' V_IND ')' INTO V_BPRME1.
CONCATENATE 'RM06E-TCSELFLAG(' V_IND ')' INTO V_TCSELFLAG1.
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0220'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=NP'.
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0220'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
V_EVRTP1.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=DETA'.
PERFORM BDC_FIELD USING V_EPSTP1
WA_RECORD-EPSTP.
PERFORM BDC_FIELD USING V_EMATN1
WA_RECORD-EMATN.
PERFORM BDC_FIELD USING V_KTMNG1
WA_RECORD-KTMNG.
PERFORM BDC_FIELD USING V_NETPR1
WA_RECORD-NETPR.
PERFORM BDC_FIELD USING V_PEINH1
WA_RECORD-PEINH.
PERFORM BDC_FIELD USING V_BPRME1
WA_RECORD-BPRME.
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0211'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'EKPO-WEBRE'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=DETZ'.
PERFORM BDC_FIELD USING 'EKPO-IDNLF'
WA_RECORD-IDNLF.
TRANSLATE WA_RECORD-EVART TO UPPER CASE.
IF WA_RECORD-EVART EQ C_WK.
PERFORM BDC_FIELD USING 'EKPO-WEBRE' 'X'.
ENDIF.
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0212'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'EKPO-MEPRF'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TXP'.
PERFORM BDC_FIELD USING 'EKPO-MEPRF'
WA_RECORD-MEPRF.
IF NOT WA_RECORD-LTEX1 IS INITIAL. "NE space.
PERFORM BDC_DYNPRO USING 'SAPMM06E' '0106'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RM06E-SELKZ(02)'.
PERFORM BDC_FIELD -
Stock Transfer Between two plants within same company code
Hello,
We are using scenario-'Stock transfer between two plants within same company code. Scenaro is like Plant A is receving plant and Plant B is delivering Plant.
Plant A release PO for 100 nos to Plant B
Plant B issues 100 nos (via delivery) to Plant A
But Plant A receives only 50 nos physically so they do Goods receipt for 50 nos , but document got generated for 100 nos (when plant B issues material).
Now Plant A do not want to receive remaining 50 nos physically, but wants to reduce material document which got created when goods issue posted by plant B
Now stock in transis (mb5t) is 50 nos.
How to reduce this material document. or any another alternative solution for this?
Thanks,
ShaileshHi There
Reversal of partial is not possible ,
But you can use the Mov Type 557 and 558 to do the adjustments in Stock in transit qty
Few more details on STO adjustments
Hi There
it can be settle in many ways,,,
1. Receive the goods as 100 and Scrap the 50 nos from the received plant,,- If the receiving plant is responsible
2.Revert the PGI/Transfer movement(Vl09) and send the 50 nos again from the supplying plant- of the Supplying plant is responsible,
3.Also we have the movement type 557 and 558 without doing the above two steps you can correct the qty from stock in transit itself,,
4. also you can check the below similar thread
STO - material lost during tranfer from plant A to plant B
5. If above are not ok, then receive the goods as 100, And raise the STO as your plant as supplying plant and receiving plant is (Supplied 50 nos less) plant,, Do the process without sending the material.. in this way that 50 nos can be adjusted,,
6.Here is some more details
557 Issue from stock in transit (adjustment posting)
Only use this movement type (also the reversal movement type) under the following circumstances:
Using movement type 557, you can correct purchase-order-independent stock in transit if
- a good receipt cannot be posted to a purchase order without stock in transit, even though there is still stock in transit according to the purchase order history
- stock in transit still exists, even though there are no open stock transfer orders for the particular material
This movement type may ONLY be used in the cases mentioned above after careful analysis, to correct stock in transit that has rounding errors.
This movement type may not be copied.
Note!
Before using this movement type, note the following:
- 392205 Analysis stock in transit / Correction if split valuation
Possible special stock indicators:
E, Q
7. As previous post says if you have the note for this issue you can use that also
You can use any one of the way to solve the issue, Hope it helps
Cheers
Senthil P -
I have problem with data transfer between Windows Server 2012RT and Windows7 (no more than 14kbps) while between Windows Sever 2012RT and Windows8.1 speed is ok.
Hi,
Regarding the issue here, please take a look at the below links to see if they could help:
Slow data transfer speed in Windows 7 or in Windows Server 2008 R2
And a blog here:
Windows Server 2012 slow network/SMB/CIFS problem
Hope this may help
Best regards
Michael
If you have any feedback on our support, please click
here.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Maybe you are looking for
-
After 1 minute of playing my music it pauses out of nowhere
i beleive that playing loud music through the speakers will fix the problem......maybe a censor problem.....but where
-
Problems after resuming from hibernation
I've been getting horizontal lines and sound distortion after resuming from hibernation. Has anyone had similar problems or found a solution for this yet? I'm on Lion OS X 10.7.3.
-
How to backup DPM database for restore DPM server (2012 R2). I try: http://technet.microsoft.com/en-us/library/hh758162.aspx To back up the DPM database On the computer where your DPM database is located, do one of the following: If the DPM database
-
my sun application server 8 hang whenever i access the admin console (http;//localhost:4848). and when i look at the task manager in process tab appserv.exe. it does not running in memory. thanks for your reply.
-
Mpower// if i use 2 ssds in port 1&2 in riad 0 can i not use hdd in sata ports 3
mpower// if i use 2 ssds in port 1&2 in riad 0 can i not use hdd in sata ports 3 4 5 6 as my hdd wont work does not show up in bios or windows// help help