Trading partner in GL, Vendor and Customer master
Hi
This is with reference to the clarification on field Trading partner in GL, vendor and customer master
We have 10 company codes and are using same COA in all co codes
We have activated Enterprise Consolidation in system and interunit profit elimination exist in our case.
Please clarify the following:-
1) Is there any impact on consolidation module if we did not maintain trading partner in GL master, vendor master & customer master
Thanks & Regards
D D Asnora
HI
It will effect in Interunit eliminations. and all the transaction which occured betweeen inter-units will be effected.
regards
Hari p
Similar Messages
-
Can I use one Business Partner repository for Vendor and Customer?
Can I use one Business Partner repository for Vendor and Customer? or do we have to use Vendor and Customer Repository separately. How can we do that? What are the pros and cons? can any one provide some examples:
Hi Deepak
The key purpose of SAP "enabling" the facility of multiple main tables in a repository is to primarily "manage" those master data objects that are related to each other. Typical examples will be a) Customer - Material, b) Supplier - Material, etc.
While, it is pretty easy to add multiple main tables in a repository, it is also important to understand the purpose of doing so based on the business requirements.
Besides, you got to be aware that in case you are "fixing" any issues with one main table (master data object) for which you have to unload the repository, the users will not be able to use the repository that has a main table defined for other master data object. Hence, there are pros and cons of using this capability of multiple main tables.
So, it is really important to understand the "W's" - What, Why, When, Where, Who of Data modeling before actually working on the "H" - How to in the SAP MDM tool.
Hope this helps.
Regards
Neelesh -
Hi,
I modified the vendor and customer master assigned in vendor master the number of the customer and viceversa
so that it will be possible the clearing between the customer and vendor but I cannot find the fields "Clrg with vend." and "Clrg with cust." in the related master data
RegardsDear sappione,
when ever you maintain Customer No. in vendor master & vendor No. in customer master. under Account control tab. pls press Enter. you will fing this fields under Payment data tab - You can find field clrg with customer like as clrg with vendor in both masters - here you can select. then it will work.
Note: Before you have select this check boxes in Document types(OBA7) here you can select KR , KZ, DR, DZ, under control data cust/vend check - pls select
Regards
shankar -
Use of trading partner field in GL Master, Vendor and Customer Master
Can anybody explain in detail what is the use of trading partner in masters.
In GL Master, whether it needs to be updated for all the GLs or only a specific GLs.The Trading partner field in customer and Vendor master is used to identify the affiliated companies involved in intercompany transactions.
The trading partner field is copied into the account receivable and payable transactions from the customer and vendor master. The Trading partner field also appears in the line items of the offsetting clearing accounts via substitutons.
The trading partner field subsequently can be used during consolidation to eliminate intercompany receivables and payables from the balance sheet and eliminate Intercompany sales and expense figures from the P&L statement.
Customer or vendor invoice: Trading partner information is captured from the customer and vendor master.
Invoice receipts against clearing account and transfers with clearing: While posting Invoice receipt during an Intercompany transaction, the invoice receipt can be posted to a clearing account instead of expense account. The selection of open items must be restricted to those with a certain trading partner when posting a transfer later on, as the trading partner is copied into the transfer line item.
Customer and Vendor Payments: If document types for payments are configured to allow for more than one trading partner in a payment document then the trading partner is copied only on the customer and vendor line item and not on the offsetting entry.
Assets transferred between company codes: If an asset is transferred between group company codes, two accounting documents are generated in each of the involved company codes. The trading partner of each document must be set to the company id of the other company code.
When goods are received from group company code the trading partner is picked for the inventory and GR/IR line items from the vendor mentioned on the order. If invoices are open as on the balance key date then group-internal provisions are created from the GR/IR accounts. These provisions can later be eliminated in Consolidation system.
Regards,
Gaurav -
Cin details in vendor and customer master
Hi
In my user id i am not getting the CIN details while using vendor and customer masters where as my coleague is getting these details while creating, displaying or editing the vendor and customer masters, please suggest regarding.
PrakashSPRO -> Logistics General -> Tax on Goods Movement -> India -> Master Data -> Assign Users to Material Master Screen Sequence for Excise Duty.
Select User Screen reference and add your username. -
Vendor and customer master creation
Hello, for my client most of the time the same customer works as a vendor too. so they want to automate the creation of customer and vendor master records simultaneously. Basically the requirement is to enter the data for vendor master and use the same data to create customer master with out using 2 tcodes XD01, XK01 and enter the data in 2 places.
Any suggestions are appriciated.
Venu.Hi,
If this is a manual entry, it is not possible with in SAP, they would have to use trwo different transactions.. Moreover the data cannot be same as they are opposites.
You can add teh vendor # in the customer master and Customer # in the vendor master.. that's be all that you can do.
even if you were to use LSMW or a Winshuttle to upload data, tehformat would still be different. so this is not possibel as far as I know -
VENDOR and Customer master Authorization
Hi Experts
I have requirement about vendor & customer master authorization.client requirement is if a user had created vendor or customer under a purchase organization or sales organization so in this case other Purchase org users shouldn't see any details about this vendor and even they shouldn't be allowed to post to this invoices.even in FBL1N and FBL5N user shouldn't see other region vendor or customer line items.how to handle to this can any one help me on this.
Thanks in advance
Regards
DiwaHi,
Just a thought;
Why can't you create a user specific validation for FB60 or other t.codes if wanted, which says that;
If the condition 'Vendor code starts with say 1* series', is met;
then display an error message 'Posting not possible for this Vendor Group XXXX'
This way, you can prevent certain users from posting transactions to a certain vendor groups.
Thanks,
Nirav -
Same Business Partner as both Vendor and Customer !!!!
Hi,
Our client has a customer, say XYZ, who is also a vendor to our client. XYZ sends them Raw Material and bills them for that. Our client sends him Finished goods and bills him for that.
When he pays our client, the amount for multiple bills of Finished Goods delivery, he adjusts the Purchase Bills with reference to his A/P Invoice Number in the total A/R Invoice value for those bills.
How to adjust that and handle this case in SAP B1???
Regards
Sudatta MohantyHi Sudatta,
please check this wiki article from the EoP & see if it helps:
[How to offset a business partner who is simultaneously a supplier and a customer? |https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=69861411]
All the best,
Kerstin -
Business Partner who is vendor and customer
Please explain me the logic behind the concept that we should not buy from customer and we should not sell to vendor in [SAP Business One|http://www.brio.co.in/sapbusinessoneoverview.aspx]. In real life it happens frequently that we buy and sell to a same person. Is there any work around? or is there any update 2007 where we can sell and purchase from same business partner.
Regards
Abdul MuneemHI Muneem,
When a question is 'why', it is quite hard to answer.
I try to help you with 'how' questions.
You can post Development Requests on the Development Forum:
[SAP Business One Product Development Collaboration|/community [original link is broken];
Solution Management checks that forum.
Hope it helps.
Jesper -
Working on IDOC OUTBOUND FOR Vendor Master and Customer Master
Hi Group,
I need to create IDOC's for Vendor master and customer master using ALE. Whenever they create vendor/customer or changes to vendor/customer should create IDOC's.
Can anyone please help me out how to proceed? I know that we can use CREMAS/DEBMAS and CREMAS04/CREMAS...But I would like to know how to use those.
Thank-You,
VenkyHi Sai,
Welcome to group.
Related to CREMAS/DEBMAS, for your situation, you can use the change pointers. With this, when ever there is an change/create, it will create an entry in CDHDR & CDPOS and based on that it will create the IDOCs for these.
Activate the change pointers for these message types and run the application RBDMIDOC periodically (whenever you want). This application will create the IDOCs based on your entries.
To activate the change pointers, the TCODEs are
BD50 Checking change pointer is activated for Message Type
BD52 Checking which fields are configured change pointer to create. (please make sure, an entry will exist in BDCP table)
I hope you know the remaining configuration related to partner profile entries (WE20) i.e. to which system you want to send the idocs and Inbound or Outbound etc.
Let me know if you need further info.
shylesh -
Bapi For creation and change for Vendor Master and Customer Master
I am looking for BAPI to create and change Vendor Master and Customer Master which will not take me to standard SAP transaction but will work in the background
Explanation: BAPI to delete material (BAPI_MATERIAL_DELETE) take you to standard SAP screen of T-Code MM06 but BAPI to create material (BAPI_MATERIAL_SAVEDATA) creates material in the background i.e. does not take you to standard SAP screen of T-Code MM01
So in my case (i.e. to create and change Vendor Master and Customer Master ) I want BAPI which would work like BAPI to create material (BAPI_MATERIAL_SAVEDATA)For general information,to find BAPIs associated with any business object :
Transaction : BAPI - choose alphabetical tab - Find customer - (right side choose - tools - create bapi list and search ) , you will get all the BAPIs associated with this particular business object
Mathews -
Vendor Master and Customer Master for FI AP/AR
hi FICO Gurus,
I am Sapna here and I have questions regarding the Mandatory fields for Vendor Master and Customer Master which would be mandatory for Running FI AP and AR. I am basically a MM Consultant but I have been asked to perform this role of Master Data at my current client.
I am quite familiar with the fact that these feilds are based on the needs of the bussiness and can be configured in IMG as required/optional or suppressed or diaplsy only.
What I am looking is
1. Are there any fileds list which is <b>Mandatory</b> for running FI AP/AR in global financial implemntation.
2. Also from FI Perspective what is <b>Good to have/Recommended fields</b> in Vendor Master and Cusotmer Master for Global Finacial implemtation.
Your help is greatly appreciated. Please point me in right direction...OK all implementations are different so the client should have some imput here.
However you need to make sure certain address details are mandatory such as name, post code street and city.
You may always want an e mail address or phone number.
All AR & AP customer/ Vendors will need a recon account, so it is important there is one set up, but you also need to make sure in change mode this cannot be changed.
For Vendors you will require some kind of bank details and payment method.
For Customers if Dunning is being used you may need the Dunning Procedure and Accounting Clerk.
Also for a Customer there is the Sales Org view, and it is best to contact the SD consultant to see which fields are required here. The tax code, payment terms are normally mandatory.
For the Purchasing Org, I guess you would know about this...
Hope this helps.
Award points if useful. -
Difference between Business Partner and Customer Master repository
What is the difference between Business Partner and Customer Master repository ?
Is the Business Partner repository to be used in case CRM is also in landscape ? or Customer master repository is good enough ?
SandeshHi,
If the landscape has both CRM and SAP ECC a business partner repository model should be good.
If it has ECC alone.a Customer Repository is needed.
But when there are many legacy systems which also contains master data fields, the standard business repository provided by SAP wont provide a good solution as it wont cover the legacy master fields..In this case its better to go for a customized repository and you can use the standard repository as a reference.
Thanks -
FB01 Enter Trading Partner for Posting Key 01 (Customer Invoice)
Dear Experts,
I would like to ask is it possible to enter the Trading Partner for the FI Document line item with Posting Key 01.
I can modify the Trading Partner for Posting Key 40 and 50 but I cannot find field in the More Data Button.
Can anyone help me to solve this issue?
Thanks.hi,
Check whether the document type you are using to post is allowed to enter the trading partner.
To check use the TCODe OBA7 and select the relevent document type. then select the check box enter trading partner under control data.
and also check the customer you assigned for that posting key 01 is got assigned trading partner in the master record or not(TCOD XD02/XD03).
thanks. -
What is procedure for creating new vendor and material master data in ABAP
What is procedure for creating new vendor and material master data in ABAP .
see below code which is used for creation of vendor master as well as extension...
*& Report ZFC_VENDOR_CREATE *
REPORT ZFC_VENDOR_CREATE LINE-SIZE 100
NO STANDARD PAGE HEADING
MESSAGE-ID ZZ.
TABLES
TABLES : SSCRFIELDS. " Fields on selection screens
CONSTANTS
DATA : C_SPLIT TYPE C VALUE '#'. " Used for Has Separator in GUI_UPLAOD
TYPES
Int'table to hold Vendor Master Data
TYPES : BEGIN OF TY_VENDOR_MASTER,
FLAG TYPE C, " Update Flag
LIFNR TYPE LIFNR, " Vendor Number
BUKRS TYPE BUKRS, " Company Code
KTOKK TYPE KTOKK, " Account Group
ANRED TYPE ANRED, " Title
NAME1 TYPE NAME1_GP, " Name1
NAME2 TYPE NAME2_GP, " Name2
SORTL TYPE SORTL, " Search Term 1
SORT2 TYPE AD_SORT2UL, " Search Term 2
STRAS TYPE STRAS_GP, " Street
PSTLZ TYPE PSTLZ, " Postal Code
ORT01 TYPE ORT01_GP, " City
REGIO TYPE REGIO, " Region
LAND1 TYPE LAND1_GP, " Country
SPRAS TYPE SPRAS, " Language
VBUND TYPE RASSC, " Trading Partner
BANKS TYPE BANKS, " Country
BANKL TYPE BANKK, " Bank Key
BANKN TYPE BANKN, " Bank Account
BKONT TYPE BKONT, " Bank Control Key
BANKA TYPE BANKA, " Name of Bank
AKONT TYPE AKONT, " Reconciliation Account
FDGRV TYPE FDGRV, " Cash Management Group
ZTERM TYPE DZTERM, " Payment Terms
REPRF TYPE REPRF, " Check Double Invoice
ZWELS TYPE DZWELS, " Payment Methods
XPORE TYPE XPORE, " Pay all items separately
END OF TY_VENDOR_MASTER,
Int'table to hold Vendor Extend Data
BEGIN OF TY_VENDOR_EXTEND,
FLAG TYPE C, " Update Flag
LIFNR TYPE LIFNR, " Vendor Number
BUKRS TYPE BUKRS, " Company Code
KTOKK TYPE KTOKK, " Account Group
REF_LIFNR TYPE LIFNR, " Reference Vendor Number
REF_BUKRS TYPE BUKRS, " Reference Company Code
AKONT TYPE AKONT, " Reconciliation Account
FDGRV TYPE FDGRV, " Cash Management Group
ZTERM TYPE DZTERM, " Payment Terms
REPRF TYPE REPRF, " Check Double Invoice
ZWELS TYPE DZWELS, " Payment Methods
XPORE TYPE XPORE, " Pay all items separately
END OF TY_VENDOR_EXTEND,
Int'table to hold Error Records Data
BEGIN OF TY_ERROR,
MSG(200) TYPE C, " To hold Message
LIFNR TYPE LIFNR, " Vendor Number
BUKRS TYPE BUKRS, " Company Code
END OF TY_ERROR.
DATA (Simple Fields)
DATA : W_COUNT TYPE I, " Variable to hold count of Records
W_SUCC_REC TYPE I, " No. of Success Records
W_SUCC_REC1 TYPE I, " No. of Updated Records
W_ERR_REC TYPE I, " No. of Error Records
w_noupdate_rec type i. " No. of Records not Changed
INTERNAL TABLES
Int'table to hold uploaded data from File
DATA : IT_VENDOR_MASTER TYPE STANDARD TABLE OF TY_VENDOR_MASTER,
WA_IT_VENDOR_MASTER TYPE TY_VENDOR_MASTER,
IT_VENDOR_EXTEND TYPE STANDARD TABLE OF TY_VENDOR_EXTEND,
WA_IT_VENDOR_EXTEND TYPE TY_VENDOR_EXTEND,
WA_IT_BDCDATA TYPE BDCDATA,
IT_BDCDATA TYPE STANDARD TABLE OF BDCDATA,
WA_IT_MESSTAB TYPE BDCMSGCOLL,
IT_MESSTAB TYPE STANDARD TABLE OF BDCMSGCOLL,
IT_ERROR TYPE STANDARD TABLE OF TY_ERROR,
WA_IT_ERROR TYPE TY_ERROR,
it_error_fk01 type standard table of ty_error,
wa_it_error_fk01 type ty_error,
it_error_fk02 type standard table of ty_error,
wa_it_error_fk02 type ty_error,
it_succ_rec1 type standard table of ty_error,
wa_it_succ_rec1 type ty_error,
it_noupdate type standard table of ty_error,
wa_it_noupdate type ty_error.
FLAGS
DATA : FL_FLAG1 TYPE C, " Flag to check error upload file
FL_FLAG2 TYPE C, " Flag to hold value
FL_FLAG3 TYPE C, " Flag to hold value
FL_FLAG4 TYPE C. " Flag to hold value
SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-001,
POSITION POS_LOW.
PARAMETERS : P_FILE(128) DEFAULT 'C:\UPLOAD.TXT' OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-002,
POSITION POS_LOW.
PARAMETERS : P_VENMAS RADIOBUTTON GROUP R1 DEFAULT 'X'.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-003,
POSITION POS_LOW.
PARAMETERS : P_VENEXT RADIOBUTTON GROUP R1.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-004,
POSITION POS_LOW.
PARAMETERS : P_MODE(1) DEFAULT 'N'.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-005,
POSITION POS_LOW.
PARAMETERS : P_GROUP(12) DEFAULT 'ZFC_VENDOR_C' OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
COMMENT 1(30) TEXT-016,
POSITION POS_LOW.
PARAMETERS : P_GROUP1(12) DEFAULT 'ZFC_VENDOR_U' OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN ON
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
Form to get file path for upload of data
PERFORM GET_FILE_PATH.
AT SELECTION-SCREEN ON BLOCK B1.
Form to Validate data specified on Selection Screen
CHECK SSCRFIELDS-UCOMM EQ 'ONLI'.
PERFORM VALIDATE_DATA.
START - OF - SELECTION
START-OF-SELECTION.
IF P_VENMAS = 'X'.
Form to upload data from Presentation Server for Vendor Master
PERFORM UPLOAD_DATA TABLES IT_VENDOR_MASTER.
IF FL_FLAG1 NE 'X'.
SORT IT_VENDOR_MASTER BY LIFNR BUKRS KTOKK.
DELETE IT_VENDOR_MASTER WHERE LIFNR = ' '
AND BUKRS = ' '
AND KTOKK = ' '.
Form to process data for Vendor Master
PERFORM INSERT_VENDOR_MASTER_DATA.
ENDIF.
ELSEIF P_VENEXT = 'X'.
Form to upload data from Presentation Server for Vendor Extend
PERFORM UPLOAD_DATA TABLES IT_VENDOR_EXTEND.
IF FL_FLAG1 NE 'X'.
SORT IT_VENDOR_EXTEND BY LIFNR BUKRS KTOKK.
DELETE IT_VENDOR_EXTEND WHERE LIFNR = ' '
AND BUKRS = ' '
AND KTOKK = ' '.
Form to process data for Vendor Master
PERFORM CHK_AND_INS_VENDOR_EXTEND_DATA.
ENDIF.
ENDIF.
END - OF - SELECTION
END-OF-SELECTION.
IF FL_FLAG1 NE 'X'.
FORMAT COLOR 7.
WRITE:/2 TEXT-O01. " Total Number of records read :
FORMAT COLOR OFF.
WRITE:40 W_COUNT.
FORMAT COLOR 7.
WRITE:/2 TEXT-O02. " Total Number of Success records :
FORMAT COLOR OFF.
WRITE:40 W_SUCC_REC.
FORMAT COLOR 7.
WRITE:/2 TEXT-O07. " Total Number of Updated records :
FORMAT COLOR OFF.
WRITE:40 W_SUCC_REC1.
FORMAT COLOR 7.
WRITE:/2 TEXT-O08. " Total Number of Unchanged records :
FORMAT COLOR OFF.
WRITE:40 W_noupdate_REC.
FORMAT COLOR 7.
WRITE:/2 TEXT-O03. " Total Number of Error records :
FORMAT COLOR OFF.
WRITE:40 W_ERR_REC.
if not it_succ_rec1 is initial.
skip 1.
perform display_changed_report.
endif.
if not it_noupdate is initial.
skip 1.
perform display_nochange_report.
endif.
IF NOT IT_ERROR IS INITIAL.
SKIP 3.
Form to display error data
PERFORM DISPLAY_ERROR_REPORT.
ENDIF.
IF FL_FLAG2 = 'X'.
SKIP 2.
FORMAT COLOR 4.
WRITE:/2 TEXT-O04. " BDC Session Name for Creation (FK01) :
FORMAT COLOR OFF.
WRITE:40 P_GROUP.
perform display_error_report_fk01.
ENDIF.
IF FL_FLAG3 = 'X'.
SKIP 2.
FORMAT COLOR 4.
WRITE:/2 TEXT-O09. " BDC Session Name for Updation (FK02) :
FORMAT COLOR OFF.
WRITE:40 P_GROUP1.
perform display_error_report_fk02.
ENDIF.
ENDIF.
*& Form GET_FILE_PATH
This form is used to get the specified path for uploading of data from
flat file with the help of F4 function key
FORM GET_FILE_PATH .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_FILE.
ENDFORM. " GET_FILE_PATH
*& Form VALIDATE_DATA
This form is used to validate the data given by user on the Selection
Screen and the appropriate message is been displayed when an wrong
entry is inputted
FORM VALIDATE_DATA .
IF SY-BATCH EQ 'X'.
CLEAR SSCRFIELDS-UCOMM.
MESSAGE E001(ZZ) WITH TEXT-011.
" Excel file not to be used in Batch Mode
ENDIF.
IF P_MODE NE 'A' AND P_MODE NE 'N' AND P_MODE NE 'E'.
MESSAGE E001(ZZ) WITH TEXT-012.
" Session Mode should be either A or N or E
ENDIF.
ENDFORM. " VALIDATE_DATA
*& Form UPLOAD_DATA
This form is used to upload data from Presentation Server for either
Vendor Master or Vendor Extend
FORM UPLOAD_DATA TABLES P_IT_VENDOR.
DATA : L_FILENAME TYPE STRING,
L_FILETYPE TYPE CHAR10 VALUE 'ASC',
L_HEADER_LENGTH TYPE I VALUE 0,
L_READ_BY_LINE TYPE CHAR01 VALUE 'X'.
MOVE P_FILE TO L_FILENAME.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_FILENAME
FILETYPE = L_FILETYPE
HEADER_LENGTH = L_HEADER_LENGTH
READ_BY_LINE = L_READ_BY_LINE
HAS_FIELD_SEPARATOR = C_SPLIT
TABLES
DATA_TAB = P_IT_VENDOR
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.
IF SY-SUBRC <> 0.
MESSAGE I001(ZZ) WITH TEXT-006 L_FILENAME.
MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
FL_FLAG1 = 'X'.
ELSEIF P_IT_VENDOR[] IS INITIAL.
MESSAGE I001(ZZ) WITH TEXT-014. " Uploaded File contains no data
FL_FLAG1 = 'X'.
ENDIF.
ENDFORM. " UPLOAD_DATA
*& Form INSERT_VENDOR_MASTER_DATA
This form is used to process BDC data for Vendor Master
FORM INSERT_VENDOR_MASTER_DATA .
DATA : L_LIFNR TYPE LIFNR.
CLEAR : L_LIFNR.
sort it_vendor_master by flag.
LOOP AT IT_VENDOR_MASTER INTO WA_IT_VENDOR_MASTER.
W_COUNT = W_COUNT + 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_MASTER-LIFNR
IMPORTING
OUTPUT = WA_IT_VENDOR_MASTER-LIFNR.
if wa_it_vendor_master-flag = 'A'.
SELECT SINGLE LIFNR
FROM LFB1
INTO L_LIFNR
WHERE LIFNR = WA_IT_VENDOR_MASTER-LIFNR
AND BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
IF SY-SUBRC EQ 0.
WA_IT_ERROR-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_ERROR-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
WA_IT_ERROR-MSG = TEXT-015.
APPEND WA_IT_ERROR TO IT_ERROR.
W_ERR_REC = W_ERR_REC + 1.
CLEAR : WA_IT_ERROR, L_LIFNR.
ELSE.
REFRESH IT_BDCDATA.
CLEAR IT_BDCDATA.
PERFORM POPULATE_BDC_DATA_VEN_MASTER.
PERFORM CALL_TRANSACTION.
ENDIF.
CLEAR : WA_IT_VENDOR_MASTER.
elseif wa_it_vendor_master-flag = 'C'.
IF FL_FLAG2 = 'X' and fl_flag4 ne 'X'.
PERFORM CLOSE_BDC_SESSION.
fl_flag4 = 'X'.
ENDIF.
REFRESH IT_BDCDATA.
CLEAR IT_BDCDATA.
PERFORM POPULATE_BDC_DATA_VEN_MASTER.
PERFORM CALL_TRANSACTION_FK02.
CLEAR : WA_IT_VENDOR_MASTER.
elseif wa_it_vendor_master-flag = 'N'.
WA_IT_noupdate-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_noupdate-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
WA_IT_noupdate-MSG = TEXT-018.
APPEND WA_IT_noupdate TO IT_noupdate.
W_noupdate_REC = W_noupdate_REC + 1.
CLEAR : WA_IT_noupdate, WA_IT_VENDOR_MASTER.
endif.
ENDLOOP.
IF FL_FLAG3 = 'X'.
PERFORM CLOSE_BDC_SESSION.
ENDIF.
ENDFORM. " INSERT_VENDOR_MASTER_DATA
*& Form POPULATE_BDC_DATA_VEN_MASTER
This form is used to populate BDC data of Vendor Master
FORM POPULATE_BDC_DATA_VEN_MASTER .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_MASTER-ZTERM
IMPORTING
OUTPUT = WA_IT_VENDOR_MASTER-ZTERM.
IF WA_IT_VENDOR_MASTER-REPRF = 'Y'.
WA_IT_VENDOR_MASTER-REPRF = 'X'.
ENDIF.
IF WA_IT_VENDOR_MASTER-XPORE = 'Y'.
WA_IT_VENDOR_MASTER-XPORE = 'X'.
ENDIF.
if wa_it_vendor_master-flag = 'A'.
PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0105',
BDC_FIELD USING 'RF02K-LIFNR' WA_IT_VENDOR_MASTER-LIFNR,
BDC_FIELD USING 'RF02K-BUKRS' WA_IT_VENDOR_MASTER-BUKRS,
BDC_FIELD USING 'RF02K-KTOKK' WA_IT_VENDOR_MASTER-KTOKK,
BDC_FIELD USING 'BDC_OKCODE' '/00'.
elseif wa_it_vendor_master-flag = 'C'.
PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0106',
BDC_FIELD USING 'RF02K-LIFNR' WA_IT_VENDOR_MASTER-LIFNR,
BDC_FIELD USING 'RF02K-BUKRS' WA_IT_VENDOR_MASTER-BUKRS,
BDC_FIELD USING 'BDC_OKCODE' '=MALL',
BDC_DYNPRO USING 'SAPMF02K' '0106',
BDC_FIELD USING 'RF02K-D0110' 'X',
BDC_FIELD USING 'RF02K-D0120' 'X',
BDC_FIELD USING 'RF02K-D0130' 'X',
BDC_FIELD USING 'RF02K-D0210' 'X',
BDC_FIELD USING 'RF02K-D0215' 'X',
BDC_FIELD USING 'RF02K-D0220' 'X',
BDC_FIELD USING 'BDC_OKCODE' '/00'.
endif.
perform :BDC_DYNPRO USING 'SAPMF02K' '0110',
BDC_FIELD USING 'LFA1-ANRED' WA_IT_VENDOR_MASTER-ANRED,
BDC_FIELD USING 'LFA1-NAME1' WA_IT_VENDOR_MASTER-NAME1,
BDC_FIELD USING 'LFA1-NAME2' WA_IT_VENDOR_MASTER-NAME2,
BDC_FIELD USING 'LFA1-SORTL' WA_IT_VENDOR_MASTER-SORTL,
BDC_FIELD USING 'LFA1-STRAS' WA_IT_VENDOR_MASTER-STRAS,
BDC_FIELD USING 'LFA1-ORT01' WA_IT_VENDOR_MASTER-ORT01,
BDC_FIELD USING 'LFA1-PSTLZ' WA_IT_VENDOR_MASTER-PSTLZ,
BDC_FIELD USING 'LFA1-LAND1' WA_IT_VENDOR_MASTER-LAND1,
BDC_FIELD USING 'LFA1-REGIO' WA_IT_VENDOR_MASTER-REGIO,
BDC_FIELD USING 'LFA1-SPRAS' WA_IT_VENDOR_MASTER-SPRAS,
BDC_FIELD USING 'BDC_OKCODE' '/00',
BDC_DYNPRO USING 'SAPMF02K' '0120',
BDC_FIELD USING 'LFA1-VBUND' WA_IT_VENDOR_MASTER-VBUND,
BDC_FIELD USING 'BDC_OKCODE' '/00',
BDC_DYNPRO USING 'SAPMF02K' '0130',
BDC_FIELD USING 'LFBK-BANKS(01)' WA_IT_VENDOR_MASTER-BANKS,
BDC_FIELD USING 'LFBK-BANKL(01)' WA_IT_VENDOR_MASTER-BANKL,
BDC_FIELD USING 'LFBK-BANKN(01)' WA_IT_VENDOR_MASTER-BANKN,
BDC_FIELD USING 'BDC_OKCODE' '=BANK',
BDC_DYNPRO USING 'SAPLBANK' '0100',
BDC_FIELD USING 'BNKA-BANKA' WA_IT_VENDOR_MASTER-BANKA,
BDC_FIELD USING 'BDC_OKCODE' '=ENTR',
BDC_DYNPRO USING 'SAPMF02K' '0130',
BDC_FIELD USING 'BDC_OKCODE' '=ENTR',
BDC_DYNPRO USING 'SAPMF02K' '0210',
BDC_FIELD USING 'LFB1-AKONT' WA_IT_VENDOR_MASTER-AKONT,
BDC_FIELD USING 'LFB1-FDGRV' WA_IT_VENDOR_MASTER-FDGRV,
BDC_FIELD USING 'BDC_OKCODE' '=/00',
BDC_DYNPRO USING 'SAPMF02K' '0215',
BDC_FIELD USING 'LFB1-ZTERM' WA_IT_VENDOR_MASTER-ZTERM,
BDC_FIELD USING 'LFB1-REPRF' WA_IT_VENDOR_MASTER-REPRF,
BDC_FIELD USING 'LFB1-ZWELS' WA_IT_VENDOR_MASTER-ZWELS,
BDC_FIELD USING 'LFB1-XPORE' WA_IT_VENDOR_MASTER-XPORE,
BDC_FIELD USING 'BDC_OKCODE' '=UPDA'.
ENDFORM. " POPULATE_BDC_DATA_VEN_MASTER
*& Form BDC_DYNPRO
This form is used to move data to BDCDATA int'table
FORM BDC_DYNPRO USING PROGRAM TYPE BDC_PROG
DYNPRO TYPE BDC_DYNR.
CLEAR WA_IT_BDCDATA.
WA_IT_BDCDATA-PROGRAM = PROGRAM.
WA_IT_BDCDATA-DYNPRO = DYNPRO.
WA_IT_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_IT_BDCDATA TO IT_BDCDATA.
ENDFORM. " BDC_DYNPRO
*& Form BDC_FIELD
This form is used to move data to BDCDATA int'table
FORM BDC_FIELD USING FNAM TYPE ANY
FVAL TYPE ANY.
CLEAR WA_IT_BDCDATA.
WA_IT_BDCDATA-FNAM = FNAM.
WA_IT_BDCDATA-FVAL = FVAL.
APPEND WA_IT_BDCDATA TO IT_BDCDATA.
ENDFORM. " BDC_FIELD
*& Form CALL_TRANSACTION
This form is used to Call FK01 for processing of data either for
Vendor Master or Vendor Extend. The error records are inserted to
Session which can be processed using SM35
FORM CALL_TRANSACTION .
DATA : L_OPTION TYPE CTU_PARAMS,
L_SUBRC TYPE SYSUBRC.
REFRESH IT_MESSTAB.
CLEAR IT_MESSTAB.
L_OPTION-DEFSIZE = 'X'.
L_OPTION-DISMODE = P_MODE.
L_OPTION-UPDMODE = 'S'.
CALL TRANSACTION 'FK01'
USING IT_BDCDATA
MESSAGES INTO IT_MESSTAB
OPTIONS FROM L_OPTION.
L_SUBRC = SY-SUBRC.
IF L_SUBRC = 0.
W_SUCC_REC = W_SUCC_REC + 1.
ELSE.
IF FL_FLAG2 NE 'X'.
PERFORM OPEN_BDC_SESSION.
FL_FLAG2 = 'X'.
ENDIF.
PERFORM BDC_INSERT.
W_ERR_REC = W_ERR_REC + 1.
PERFORM ERROR_RECORD_DATA.
ENDIF.
ENDFORM. " CALL_TRANSACTION
*& Form OPEN_BDC_SESSION
Form used to open session for Error out Records
FORM OPEN_BDC_SESSION .
DATA : L_USERID TYPE APQ_MAPN, " Variable to hold user-id
L_GROUP TYPE APQ_GRPN. " Variable to hold value
MOVE P_GROUP TO L_GROUP.
MOVE SY-UNAME TO L_USERID.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = L_GROUP
KEEP = SPACE
USER = L_USERID
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-008. " Unable to open BDC Session
ENDIF.
ENDFORM. " OPEN_BDC_SESSION
*& Form BDC_INSERT
This form is used to insert error records to a Session method
FORM BDC_INSERT .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'FK01'
TABLES
DYNPROTAB = IT_BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-009. " Unable to Insert Data to BDC Session
ENDIF.
ENDFORM. " BDC_INSERT
*& Form ERROR_RECORD_DATA
This form is used to process the messages for the error records which
will be displayed on the output report
FORM ERROR_RECORD_DATA .
DATA : L_LINES TYPE I,
L_MSG(200) TYPE C.
DESCRIBE TABLE IT_MESSTAB LINES L_LINES.
READ TABLE IT_MESSTAB INTO WA_IT_MESSTAB INDEX L_LINES.
IF SY-SUBRC = 0.
CLEAR L_MSG.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = WA_IT_MESSTAB-MSGID
LANG = SY-LANGU
NO = WA_IT_MESSTAB-MSGNR
V1 = WA_IT_MESSTAB-MSGV1
V2 = WA_IT_MESSTAB-MSGV2
V3 = WA_IT_MESSTAB-MSGV3
V4 = WA_IT_MESSTAB-MSGV4
IMPORTING
MSG = L_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WA_IT_ERROR_fk01-MSG = L_MSG.
ENDIF.
IF P_VENMAS = 'X'.
WA_IT_ERROR_fk01-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_ERROR_fk01-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
ELSEIF P_VENEXT = 'X'.
WA_IT_ERROR_fk01-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
WA_IT_ERROR_fk01-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
ENDIF.
APPEND WA_IT_ERROR_fk01 TO IT_ERROR_fk01.
CLEAR WA_IT_ERROR_fk01.
ENDIF.
ENDFORM. " ERROR_RECORD_DATA
*& Form CLOSE_BDC_SESSION
Form used to close session of the Error Records
FORM CLOSE_BDC_SESSION .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-010. " Unable to Close BDC Session
ENDIF.
ENDFORM. " CLOSE_BDC_SESSION
*& Form CHK_AND_INS_VENDOR_EXTEND_DATA
This form is used to process BDC data for Vendor Extend
FORM CHK_AND_INS_VENDOR_EXTEND_DATA .
DATA : L_LIFNR TYPE LIFNR.
CLEAR : L_LIFNR, fl_flag4.
sort it_vendor_extend by flag.
LOOP AT IT_VENDOR_EXTEND INTO WA_IT_VENDOR_EXTEND.
W_COUNT = W_COUNT + 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_EXTEND-REF_LIFNR
IMPORTING
OUTPUT = WA_IT_VENDOR_EXTEND-REF_LIFNR.
if wa_it_vendor_extend-flag = 'A'.
SELECT SINGLE LIFNR
FROM LFB1
INTO L_LIFNR
WHERE LIFNR = WA_IT_VENDOR_EXTEND-REF_LIFNR
AND BUKRS = WA_IT_VENDOR_EXTEND-REF_BUKRS.
IF SY-SUBRC NE 0.
WA_IT_ERROR-LIFNR = WA_IT_VENDOR_EXTEND-REF_LIFNR.
WA_IT_ERROR-BUKRS = WA_IT_VENDOR_EXTEND-REF_BUKRS.
WA_IT_ERROR-MSG = TEXT-007.
APPEND WA_IT_ERROR TO IT_ERROR.
W_ERR_REC = W_ERR_REC + 1.
CLEAR : WA_IT_ERROR, L_LIFNR.
ELSE.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_EXTEND-LIFNR
IMPORTING
OUTPUT = WA_IT_VENDOR_EXTEND-LIFNR.
SELECT SINGLE LIFNR
FROM LFB1
INTO L_LIFNR
WHERE LIFNR = WA_IT_VENDOR_EXTEND-LIFNR
AND BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
IF SY-SUBRC EQ 0.
WA_IT_ERROR-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
WA_IT_ERROR-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
WA_IT_ERROR-MSG = TEXT-015.
APPEND WA_IT_ERROR TO IT_ERROR.
W_ERR_REC = W_ERR_REC + 1.
CLEAR : WA_IT_ERROR, L_LIFNR.
ELSE.
REFRESH IT_BDCDATA.
CLEAR IT_BDCDATA.
PERFORM POPULATE_BDC_DATA_VEN_EXTEND.
PERFORM CALL_TRANSACTION.
ENDIF.
ENDIF.
CLEAR : WA_IT_VENDOR_EXTEND.
elseif wa_it_vendor_extend-flag = 'C'.
IF FL_FLAG2 = 'X' and fl_flag4 ne 'X'.
PERFORM CLOSE_BDC_SESSION.
fl_flag4 = 'X'.
ENDIF.
REFRESH IT_BDCDATA.
CLEAR IT_BDCDATA.
PERFORM POPULATE_BDC_DATA_VEN_extend.
PERFORM CALL_TRANSACTION_FK02.
CLEAR : WA_IT_VENDOR_EXTEND.
elseif wa_it_vendor_extend-flag = 'N'.
WA_IT_noupdate-LIFNR = WA_IT_VENDOR_extend-LIFNR.
WA_IT_noupdate-BUKRS = WA_IT_VENDOR_extend-BUKRS.
WA_IT_noupdate-MSG = TEXT-019.
APPEND WA_IT_noupdate TO IT_noupdate.
W_noupdate_REC = W_noupdate_REC + 1.
CLEAR : WA_IT_noupdate, WA_IT_VENDOR_EXTEND.
endif.
ENDLOOP.
IF FL_FLAG2 = 'X'.
PERFORM CLOSE_BDC_SESSION.
ENDIF.
if fl_flag3 = 'X'.
PERFORM CLOSE_BDC_SESSION.
ENDIF.
ENDFORM. " CHK_AND_INS_VENDOR_EXTEND_DATA
*& Form POPULATE_BDC_DATA_VEN_EXTEND
This form is used to populate BDC data of Vendor Extend
FORM POPULATE_BDC_DATA_VEN_EXTEND .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = WA_IT_VENDOR_EXTEND-ZTERM
IMPORTING
OUTPUT = WA_IT_VENDOR_EXTEND-ZTERM.
IF WA_IT_VENDOR_EXTEND-REPRF = 'Y'.
WA_IT_VENDOR_EXTEND-REPRF = 'X'.
ENDIF.
IF WA_IT_VENDOR_extend-XPORE = 'Y'.
WA_IT_VENDOR_extend-XPORE = 'X'.
ENDIF.
if wa_it_vendor_extend-flag = 'A'.
PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0105',
BDC_FIELD USING 'RF02K-LIFNR' WA_IT_VENDOR_EXTEND-LIFNR,
BDC_FIELD USING 'RF02K-BUKRS' WA_IT_VENDOR_EXTEND-BUKRS,
BDC_FIELD USING 'RF02K-KTOKK' WA_IT_VENDOR_EXTEND-KTOKK,
BDC_FIELD USING 'RF02K-REF_LIFNR'
WA_IT_VENDOR_EXTEND-REF_LIFNR,
BDC_FIELD USING 'RF02K-REF_BUKRS'
WA_IT_VENDOR_EXTEND-REF_BUKRS,
BDC_FIELD USING 'BDC_OKCODE' '/00'.
elseif wa_it_vendor_extend-flag = 'C'.
PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0106',
BDC_FIELD USING 'RF02K-LIFNR' WA_IT_VENDOR_extend-LIFNR,
BDC_FIELD USING 'RF02K-BUKRS' WA_IT_VENDOR_extend-BUKRS,
BDC_FIELD USING 'RF02K-D0210' 'X',
BDC_FIELD USING 'RF02K-D0215' 'X',
BDC_FIELD USING 'BDC_OKCODE' '/00'.
endif.
perform :BDC_DYNPRO USING 'SAPMF02K' '0210',
BDC_FIELD USING 'LFB1-AKONT' WA_IT_VENDOR_EXTEND-AKONT,
BDC_FIELD USING 'LFB1-FDGRV' WA_IT_VENDOR_EXTEND-FDGRV,
BDC_FIELD USING 'BDC_OKCODE' '=/00',
BDC_DYNPRO USING 'SAPMF02K' '0215',
BDC_FIELD USING 'LFB1-ZTERM' WA_IT_VENDOR_EXTEND-ZTERM,
BDC_FIELD USING 'LFB1-REPRF' WA_IT_VENDOR_EXTEND-REPRF,
BDC_FIELD USING 'LFB1-ZWELS' WA_IT_VENDOR_EXTEND-ZWELS,
BDC_FIELD USING 'LFB1-XPORE' WA_IT_VENDOR_extend-XPORE,
BDC_FIELD USING 'BDC_OKCODE' '=UPDA'.
ENDFORM. " POPULATE_BDC_DATA_VEN_EXTEND
*& Form DISPLAY_ERROR_REPORT
This form is used to display the error records on the output screen
FORM DISPLAY_ERROR_REPORT .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O05. " Error List for Vendor Master
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O06. " Error List for Vendor Master Extended
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number
17 SY-VLINE,
18 TEXT-H02, " Company Code
31 SY-VLINE,
32 TEXT-H03, " Error Message
100 SY-VLINE.
FORMAT COLOR OFF.
WRITE:/ SY-ULINE(100).
LOOP AT IT_ERROR INTO WA_IT_ERROR.
FORMAT COLOR 2.
WRITE:/1 SY-VLINE,
2 WA_IT_ERROR-LIFNR,
17 SY-VLINE,
18 WA_IT_ERROR-BUKRS,
31 SY-VLINE,
32 WA_IT_ERROR-MSG,
100 SY-VLINE.
CLEAR : WA_IT_ERROR.
FORMAT COLOR OFF.
ENDLOOP.
WRITE:/ SY-ULINE(100).
ENDFORM. " DISPLAY_ERROR_REPORT
*& Form CALL_TRANSACTION_FK02
Form used to Call Transaction FK02
form CALL_TRANSACTION_FK02 .
DATA : L_OPTION TYPE CTU_PARAMS,
L_SUBRC TYPE SYSUBRC.
REFRESH IT_MESSTAB.
CLEAR IT_MESSTAB.
L_OPTION-DEFSIZE = 'X'.
L_OPTION-DISMODE = P_MODE.
L_OPTION-UPDMODE = 'S'.
CALL TRANSACTION 'FK02'
USING IT_BDCDATA
MESSAGES INTO IT_MESSTAB
OPTIONS FROM L_OPTION.
L_SUBRC = SY-SUBRC.
IF L_SUBRC = 0.
W_SUCC_REC1 = W_SUCC_REC1 + 1.
WA_IT_succ_rec1-MSG = Text-017.
IF P_VENMAS = 'X'.
WA_IT_succ_rec1-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_succ_rec1-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
ELSEIF P_VENEXT = 'X'.
WA_IT_succ_rec1-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
WA_IT_succ_rec1-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
ENDIF.
APPEND WA_IT_succ_rec1 TO IT_succ_rec1.
ELSE.
IF FL_FLAG3 NE 'X'.
PERFORM OPEN_BDC_SESSION_fk02.
FL_FLAG3 = 'X'.
ENDIF.
PERFORM BDC_INSERT_fk02.
W_ERR_REC = W_ERR_REC + 1.
PERFORM ERROR_RECORD_DATA1.
ENDIF.
endform. " CALL_TRANSACTION_FK02
*& Form OPEN_BDC_SESSION_fk02
Form used to Open session for FK02
form OPEN_BDC_SESSION_fk02 .
DATA : L_USERID TYPE APQ_MAPN, " Variable to hold user-id
L_GROUP TYPE APQ_GRPN. " Variable to hold value
MOVE P_GROUP1 TO L_GROUP.
MOVE SY-UNAME TO L_USERID.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = L_GROUP
KEEP = SPACE
USER = L_USERID
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-008. " Unable to open BDC Session
ENDIF.
endform. " OPEN_BDC_SESSION_fk02
*& Form BDC_INSERT_fk02
Form used to insert data into BDC session using FK02
form BDC_INSERT_fk02 .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'FK02'
TABLES
DYNPROTAB = IT_BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-009. " Unable to Insert Data to BDC Session
ENDIF.
endform. " BDC_INSERT_fk02
*& Form display_changed_report
Form to display Updated Vendor data
form display_changed_report .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O10. " Updated List for Vendor Master
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O11. " Updated List for Vendor Master Extended
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number
17 SY-VLINE,
18 TEXT-H02, " Company Code
31 SY-VLINE,
32 TEXT-H04, " Message
100 SY-VLINE.
FORMAT COLOR OFF.
WRITE:/ SY-ULINE(100).
LOOP AT IT_succ_rec1 INTO WA_IT_succ_rec1.
FORMAT COLOR 2.
WRITE:/1 SY-VLINE,
2 WA_IT_succ_rec1-LIFNR,
17 SY-VLINE,
18 WA_IT_succ_rec1-BUKRS,
31 SY-VLINE,
32 WA_IT_succ_rec1-MSG,
100 SY-VLINE.
CLEAR : WA_IT_succ_rec1.
FORMAT COLOR OFF.
ENDLOOP.
WRITE:/ SY-ULINE(100).
endform. " display_changed_report
*& Form display_nochange_report
Form to display No Changed data for Vendors
form display_nochange_report .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O12. " No Changes List for Vendor Master
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O13. " No Changes List for Vendor Master Extended
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number
17 SY-VLINE,
18 TEXT-H02, " Company Code
31 SY-VLINE,
32 TEXT-H04, " Message
100 SY-VLINE.
FORMAT COLOR OFF.
WRITE:/ SY-ULINE(100).
LOOP AT IT_noupdate INTO WA_IT_noupdate.
FORMAT COLOR 2.
WRITE:/1 SY-VLINE,
2 WA_IT_noupdate-LIFNR,
17 SY-VLINE,
18 WA_IT_noupdate-BUKRS,
31 SY-VLINE,
32 WA_IT_noupdate-MSG,
100 SY-VLINE.
CLEAR : WA_IT_noupdate.
FORMAT COLOR OFF.
ENDLOOP.
WRITE:/ SY-ULINE(100).
endform. " display_nochange_report
*& Form ERROR_RECORD_DATA1
Form to get Error Message for Changed Vendors
form ERROR_RECORD_DATA1 .
DATA : L_LINES TYPE I,
L_MSG(200) TYPE C.
DESCRIBE TABLE IT_MESSTAB LINES L_LINES.
READ TABLE IT_MESSTAB INTO WA_IT_MESSTAB INDEX L_LINES.
IF SY-SUBRC = 0.
CLEAR L_MSG.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = WA_IT_MESSTAB-MSGID
LANG = SY-LANGU
NO = WA_IT_MESSTAB-MSGNR
V1 = WA_IT_MESSTAB-MSGV1
V2 = WA_IT_MESSTAB-MSGV2
V3 = WA_IT_MESSTAB-MSGV3
V4 = WA_IT_MESSTAB-MSGV4
IMPORTING
MSG = L_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WA_IT_ERROR_fk02-MSG = L_MSG.
ENDIF.
IF P_VENMAS = 'X'.
WA_IT_ERROR_fk02-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
WA_IT_ERROR_fk02-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
ELSEIF P_VENEXT = 'X'.
WA_IT_ERROR_fk02-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
WA_IT_ERROR_fk02-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
ENDIF.
APPEND WA_IT_ERROR_fk02 TO IT_ERROR_fk02.
CLEAR WA_IT_ERROR_fk02.
ENDIF.
endform. " ERROR_RECORD_DATA1
*& Form display_error_report_fk01
Form to display Error Report for Master Vendors (FK01)
form display_error_report_fk01 .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O05. " Error List for Vendor Master (FK01)
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O06. " Error List for Vendor Master Extended (FK01)
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number
17 SY-VLINE,
18 TEXT-H02, " Company Code
31 SY-VLINE,
32 TEXT-H04, " Message
100 SY-VLINE.
FORMAT COLOR OFF.
WRITE:/ SY-ULINE(100).
LOOP AT IT_ERROR_fk01 INTO WA_IT_ERROR_fk01.
FORMAT COLOR 2.
WRITE:/1 SY-VLINE,
2 WA_IT_ERROR_fk01-LIFNR,
17 SY-VLINE,
18 WA_IT_ERROR_fk01-BUKRS,
31 SY-VLINE,
32 WA_IT_ERROR_fk01-MSG,
100 SY-VLINE.
CLEAR : WA_IT_ERROR_fk01.
FORMAT COLOR OFF.
ENDLOOP.
WRITE:/ SY-ULINE(100).
endform. " display_error_report_fk01
*& Form display_error_report_fk02
Form to display Error Report for changed Vendors (FK02)
form display_error_report_fk02 .
IF P_VENMAS = 'X'.
WRITE:/ TEXT-O14. " Error List for Vendor Master (FK02)
ELSEIF P_VENEXT = 'X'.
WRITE:/ TEXT-O15. " Error List for Vendor Master Extended (FK02)
ENDIF.
WRITE:/ SY-ULINE(100).
FORMAT COLOR 1.
WRITE:/1 SY-VLINE,
2 TEXT-H01, " Vendor Number
Maybe you are looking for
-
Iphoto wont open- error message says its an unreleased version
I crashed whilst using iphoto 4, and now when I try opening it, a message says: "The photo library was created with an unreleased version of iphoto. Please quit and upgrade this library by opening it in iphoto 2 or iphoto 4" I have repaired the disk
-
Before I throw my iMac G5 !!
Yes, iMac G5 ,512RAM ,160GB , 17" . Tiger 10.4.11 was installed on the previous hard drive ( before it damaged ), with EFI firmware 1.9 , After I replaced the hard drive with a new one I tried to boot from the original Tiger CD1 but it seems no chanc
-
What's the 'best practice' way to get email and fax number from vendor?
Hello *, could anybody let me know what the 'best-practice' is to get the fax number and smtp address from the vendor master? Is there a preferred function module I should use? Thanks a lot, Torsten
-
CS6 - Unable to patch to 8.0.1
I am using InDesign CS6 version 8.0 on an XP SP3 machine. I understand that there has been a patch since this version but when I run the Adobe Application Manager it tells me that I am up-to-date. How do I get the latest update?
-
Hello. I have a problem with a web application that handles 3 languages (English, Spanish and Portuguese). The web pages are showed correctly using the fmt:message tag library. But, one of the application features is to send email notifications, and