BDC program to change to vendor master
Can anyone give me a sample BDC code to change vendor master MK02
After entering the Vendor number and selecting the checkboxes Address and Control in the first screen if i take enter it should go to the second screen which contains all fields of address to modify but My code is giving the screen 0110 which contains only few fields,even though i prepared BDC table with 0111 screen, but the actual screen to be called is 0111.
Can anyone send the sample code or give me the solution
Thanks,
DATA : lv_filename TYPE STRING,
V_TEXTOUT TYPE T100-TEXT,
v_tcode TYPE tcode.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA: MESSTAB TYPE STANDARD TABLE OF BDCMSGCOLL ,
MESSTAB1 TYPE BDCMSGCOLL.
DATA : ITAB_FILETAB TYPE FILETABLE.
CONSTANTS: C_TCODE(4) TYPE C VALUE 'AS02', " Assets master data Change - Transaction
C_N TYPE C VALUE 'N', " Not to display screens while call transaction
C_E TYPE C VALUE 'E', " Error
C_S TYPE C VALUE 'S'.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS : P_FILE TYPE STRING OBLIGATORY,
P_APPL TYPE FILENAME-FILEEXTERN DEFAULT '/usr/sap/tmp/test_asset.txt' OBLIGATORY LOWER CASE,
P_ALV TYPE C AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM GET_FILENAME_UPLOAD_FILE.
AT SELECTION-SCREEN ON P_FILE.
PERFORM CHECK_FILE_EXISTS.
START-OF-SELECTION.
PERFORM READ_FILE .
PERFORM FILL_TAB.
PERFORM GET_FINAL_RECORD.
PERFORM BDC_REC.
FORM CHECK_FILE_EXISTS.
DATA: V_FILENAME TYPE STRING,
V_RET TYPE C.
V_FILENAME = P_FILE .
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE = V_FILENAME
RECEIVING
RESULT = V_RET
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
OTHERS = 5.
IF NOT ( SY-SUBRC = 0 AND V_RET = 'X' ).
MESSAGE E000(100) WITH 'file does not exits '.
ENDIF.
ENDFORM.
*& Form GET_FILENAME_UPLOAD_FILE
select the file on presentation server using F4 option.
FORM GET_FILENAME_UPLOAD_FILE.
DATA: V_TITLE TYPE STRING,
V_RC TYPE I.
V_TITLE = 'WINDOW ' .
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = V_TITLE
DEFAULT_FILENAME = '*.txt'
INITIAL_DIRECTORY = 'C:\'
MULTISELECTION = ' ' "No multiple selection
CHANGING
FILE_TABLE = ITAB_FILETAB
RC = V_RC.
READ TABLE ITAB_FILETAB INTO P_file INDEX 1.
ENDFORM.
FORM READ_FILE .
lv_filename = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = lv_filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = ITAB_FILE
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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
FORM BDC_REC .
DATA user_date TYPE sy-datum.
DATA : DATE_FORMAT(10) TYPE C,
TEMP(2) TYPE C,
ROW TYPE STRING ,
ROW1 TYPE STRING.
LOOP at ITAB_FINAL INTO WA_FINAL .
CONCATENATE WA_FINAL-afabg6(4) WA_FINAL-afabg0(2) WA_FINAL-afabg+3(2) INTO USER_DATE .
WRITE USER_DATE TO DATE_FORMAT.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-ANLN1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'ANLA-ANLN1'
WA_FINAL-ANLN1 . "'158'.
PERFORM BDC_FIELD USING 'ANLA-ANLN2'
WA_FINAL-ANLN2 . "'0'.
PERFORM BDC_FIELD USING 'ANLA-BUKRS'
WA_FINAL-BUKRS . "'2600'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB08'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ANLA-TXT50'.
PERFORM BDC_FIELD USING 'ANLA-TXT50'
'PUMP/ATTACK REAGENT METERING'.
PERFORM BDC_FIELD USING 'ANLH-ANLHTXT'
'PUMP/ATTACK REAGENT METERING'.
PERFORM BDC_FIELD USING 'ANLA-INVNR'
'DB1LA607251CNWF'.
PERFORM BDC_FIELD USING 'ANLA-MENGE'
'1'.
PERFORM BDC_FIELD USING 'ANLA-MEINS'
'EA'.
PERFORM BDC_FIELD USING 'ANLA-INKEN'
'X'.
PERFORM BDC_FIELD USING 'ANLA-AKTIV'
'07/01/1984'.
PERFORM BDC_DYNPRO USING 'SAPLAIST' '1000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BUCH'.
CLEAR TEMP.
*TEMP = WA_FINAL-LINENO.
CONCATENATE 'ANLB-WBIND(' WA_FINAL-LINENO ')' INTO ROW1 .
PERFORM BDC_FIELD USING 'BDC_CURSOR'
ROW1 ."'ANLB-WBIND(06)'.
CONCATENATE 'ANLB-AFABG(' WA_FINAL-LINENO ')' INTO row.
PERFORM BDC_FIELD USING row
DATE_FORMAT . "wa_file-afabg . "'12/01/1985'.
CALL TRANSACTION C_TCODE USING BDCDATA
MODE C_N
UPDATE C_S
MESSAGES INTO MESSTAB.
IF SY-SUBRC EQ 0.
READ TABLE MESSTAB INTO MESSTAB1 WITH KEY MSGTYP = C_S.
IF SY-SUBRC EQ 0.
Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
MSGID = MESSTAB1-MSGID
MSGNR = MESSTAB1-MSGNR
MSGV1 = MESSTAB1-MSGV1
MSGV2 = MESSTAB1-MSGV2
MSGV3 = MESSTAB1-MSGV3
MSGV4 = MESSTAB1-MSGV4
IMPORTING
MESSAGE_TEXT_OUTPUT = V_TEXTOUT.
Build Success table ready for output
MOVE-CORRESPONDING WA_FINAL TO WA_SUCCESS.
WA_SUCCESS-MESS = V_TEXTOUT.
APPEND WA_SUCCESS TO ITAB_SUCCESS.
CLEAR: WA_SUCCESS .
ENDIF.
ELSE.
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
Similar Messages
-
Update withholding tax records post change in vendor master recepient type
Dear All,
We have created a company ( recepient type CO) vendor wrongly with recepient type defined as OT- Others. The invoices were posted, TDS deducted and paid by selecting proper tax code / rate for corporate and not for others.
However as the vendor master record has the recepient type as OT - the same is updated in the with_item table for all the TDS entries in documents posted for the vendor.
We want to change the recepient type to Company - CO to correct the error in the vendor master record. However when we change the same to CO, the existing line items in with_item table are not updated for recepient type. Thus the open invoices are classified under recepient type OT - others even after change in vendor master. This is affecting our payment of TDS.
Kindly guide how to update the records already posted in SAP to change the recepient type.
Regards,
SAP_2009Any inputs?
-
Can't make changes in vendor master fields
hi
i am trying ot make changes in vendor master but most of fields are grayed out donno know to make them writeable and changeable
can someone help me plz
thanksDear:
Please check have the fields in vendors master date been set as display mode in OB23 . This will resolve your issue.
Regards -
How to accept changes in Vendor master record as an accounting clerk?
I made some changes in vendor master records and they are yet to be confirmed by accounting clerk!! so , how can I do that in my development system?
Hi,
I guess you posted your query in wrong forum.
This forum is related to tool Test Data Migration Server (TDMS) which is used to transfer reduced set of data from a production system to a test or quality system.
In case you are using TDMS and having any issue, please give more details of the problem.
Regards,
Rupam -
Program for customer and vendor master
Hi All,
I am working with ale-idocs. could you plese tell me the program name for transferring the customer and vendor master data.
thanks in adavance,
Sugeet.Hi Sugeet,
You can transfer the Customer/Vendor master data by activating change pointers or by using RBDSEDEB/RBDSECRE programs manually by giving the customer or vendor number. But for both the methods you need to configure the partner profile settings.
Regards,
Rajesh -
Mobile Number Change in Vendor Master
Hi,
We have a problem, we want to change mobile number of about 1000 number vendors in vendor master, we have created lsmw thru t-code xk02, fk02 but it is saving mobile number in recording, but actually not changing mobile number in material master. Reason, the screen is different, in lsmw and xk02.
Can somebody help me.
IshuHi Ishu,
Yes, transactions can behave differently in recordings than when run manually. There's a system variable that the programs can check to find out how they are started and then behave differently dependent on it.
Therefore it is suggested to avoid recordings as much as possible and use standard SAP tools instead. In this case, there's BAPI available for updating vendor addresses:
Object BUS4001
Method SAVEREPLICA
BR
Raf -
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 -
RFWT0010 withholding tax type and tax code change in vendor master problem
Hi
Due to some reasons I need to change the withholding tax type and tax code in vendor master.
When i am running the report RFWT010,After changing the tax type and tax code in vendor master...the list contains no items. eventhough there are 14 line items for the vendor that are required to be adjusted with new tax type.
Please suggest how to solve this query.
regards
yesap.ficoAny inputs?
-
Mass change to vendor master records
Hello,
We have implemented classic extended scenario with SRM5 and will be outputting our Purchase Orders, i.e. email,fax,print from SRM as this is out leading PO.
How do we mass change vendor master (BP) records in SRM as we have not set the output medium in the Business Partner (BP) records and would like to do so with a transaction simalar to the R/3 XK99 Vendor Mass Maintanance transaction. Is their an equivalent one avaiable for BP records?
Thanks. Steve.Hi Steve,
The send Medium is stored in table "BBPM_BUT_FRG0061" in SRM.
You may try to add the send_medium to the vendor mass maintenance tcode. But, I am not sure whether this is a good practice. Pls try this first in a sandbox...
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Execute transaction "MASSOBJ", select BussObj BUS1006 & double click Application tables. Add the table "BBPM_BUT_FRG0061" for BUS1006.
Then double click the field list for this table & add the SEND_MEDIUM & any other key field over which you would want to maintain this field.
Then execute tcode "MASS" for BUS1006 to mass change the send_medium field.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I would always prefer the LSMW mode rather. Let me know how it goes.
Cheers,
Akash -
Error as IBAN required when the user confirms the changes to Vendor master
Hi,
After making the change to vendor bank details in master user is managed to save the changes with out any errors. Now another user is trying to confirm the changes, here is system is throughing error as IBAN is required for vendor master..
Scenrio is Co code belongs Switzerland and the vendor country Kuwait..
Can anybody through some light, to solve the issue without generate or maintaining the IBAN, Since we dont have IBAN no provided for vendor.
Thanks in advance..Hi Murali
Please check the configuration in FBZP payment method in Country/Payment Method in Company code. In that you can mandaatory the fields like address/IBAN for master records. Pls check that setting try to save the master.
Regareds
Surya -
How to restrict changes to Vendor Master withholdind tax data
Dear Experts,
I want restrict users to make any changes to withholding tax data in vendor master,please suggest solution
Regards,
VarunHi
You can restrict the user with authorization control. Take the basis help and create the seprate role for Change Vendor master WHT
And assign to all the user.
regards
Prasanna -
Need help with an SHDB BDC program for Change outbound delivery(VL02N).
I have created recording to change outbound delivery(VL02N). Steps are as below-
For VL02N recording 1st I have click on the header(F8) then dates tab.
Then insert line (+ button) then it shows 8 transport types.
I have chosen 7th transport type. In SHDB it shows BDC_CURSOR = '08/07'.
Then I have created BDC program for this recording, but it's not working,
because It is changing BDC_CURSOR value every time when we do SHDB or VL02N and in my code I have hard coded BDC_CURSOR = '08/07' .
Can anyone tell me how to get this BDC_CURSOR changed value. So that instead of hard coding this value I can select this value every time.
(FYI For this Screen name = SAPMSSY0 Screen No = 0120.)
Thanks.I have created recording to change outbound delivery(VL02N). Steps are as below-
For VL02N recording 1st I have click on the header(F8) then dates tab.
Then insert line (+ button) then it shows 8 transport types.
I have chosen 7th transport type. In SHDB it shows BDC_CURSOR = '08/07'.
Then I have created BDC program for this recording, but it's not working,
because It is changing BDC_CURSOR value every time when we do SHDB or VL02N and in my code I have hard coded BDC_CURSOR = '08/07' .
Can anyone tell me how to get this BDC_CURSOR changed value. So that instead of hard coding this value I can select this value every time.
(FYI For this Screen name = SAPMSSY0 Screen No = 0120.)
Thanks. -
Change of Vendor Master Re-con Account in MIRO Transaction
Hi Friends.
Thanks in Advance,
Requirement : While Posting the MIRO Transaction, Vendor Master Re-con Account has to be Replace by other Re-con account
Using Business Transactions Events this can be achived and sucessfully replaced. also data based Tables BSEG also updated sucessfully.
But the problem is when viewing the reports like FAGLL03, FAGLB03 we can able to view the data against that G/L Account.
Regards:
Sridhar.JHi Sridhar,
Let me know what is the business requirement to assign separate GL account while doing MIRO ? Which BTE used for that ? If you don't mind.
Rgds
SumaMani -
Changes to vendor master to be effective in back date
Dear Friends
We have created a PO two months before with domestic schema group by mistake
Goods arrived after two moths of PO then realised that this a import PO and the PO is not having import conditions.
Now we have changed the schemagroup of vendor to import vendor.
But the changes to vendor should be effective in the PO which was created two months before then only we can make entries in the PO for the conditions.
Any focus on this
Thanks
Cnr- Reverse all the invoices & material documents if posted.
- Make vendor changes for the correct vendor schema group .
- In change PO, go to item conditions tab & press "Update" button for updating the prices.
Try this. it should help.
Thanks,
Amit -
Extract the new , changed , deleted vendor master data -urgent pls
Hi all,
I have require ment like i need to extract all new, changed and deleted data from SAP TO MAXIMO
i need to send to a windows environment which both systems share,
i am using LFA1 ,CDHDR , CDPOS Tables , i will get the reuired information , can i use gui_download
to download to windows environment which both system are mapped to a common shared folder.
i will extract the infrmation and sent to a shared folder.
this a backround job schedule daily once.and also i have to sent the file contents to spool also.
please suggent some code existing or how to do the logic behind.
shall i use open data set
read data set
close data set.
please suggest ways of doing............urgent.
regards
kodamanchiliWith regards to the writing out of the data that, you are correct that you should use the Data Set commands if you are attempting to write a file out to the application server. If you are using any sort of EAI tool then there maybe are other ways specific to the tool for sending data, such as some of the tools utilize RFCs to send the data.
For the actual identifying of the changed records, it is best not to write delta interfaces directly against the change document tables (CDHDR and CDPOS). Instead you should be ustilizing change pointers. Change pointers are transient data stored in the BDCP and BDCPS tables (combiend togehter into view BDCPV) or stored in BDCP2 if configured to use this newer change poitner table for much better performance.
An instance of a change pointer in the change pointer tables will indicate the record that has changed and point to the changed document in the change document tables that can be referenced to extract more specific information.
The nice thing about change pointers are:
- They are transient, at the end of your extract you clear the ones that you've extracted so that the next time you will get the ones that have been pulled since then.
- You can setup instances of your change pointer object that are specific to an extract program so that two extract programs for similiar or even completly the same data won't itnerfere with each other.
- The CDHDR and CDPOS tables are great for extracting changes that have occured over time for a specific instance of a buisenss document (ex. Vendor) but do not perform well over time for extracting all changes associated with all instances of a buisness document (ex. All vendors that have had changes since the last run of the program). Programs that extract directly against CDHDR and CDPOS do perform delta extract functionality are oftern a performance problem as time progresses and the tables grow in size. If used properly Change Pointers are efficient becuase the tabels can be kept small and are optimized for the extracting of deltas.
For any tables that log change documents in CDHDR and CDPOS you can configure change pointers to be populated in the BDCP* tables.
Change pointer configuration:
- BD61 - Activate change pointers globally within the SAP instance
- WE81 - Need to create an ALE message type (even if you're not actaully going to connect it to an IDoc)
- BD50 - Activate change pointer functionality for your message type
- BD52 - Define the individual change documents, tables and fields that you want to have as part of your tracking
Your extract program will use two functions:
- CHANGE_POINTERS_READ - Use this to get a list of all change pointers since the last execution
- CHANGE_POINTERS_STATUS_WRITE - Use this to mark the change pointers as extracted so that they won't get picked up on the next execution
Transaction BD22 (Program RBDCPCLR) should be scheduled to run regularily to delete from the change pointer tables the records that have been marked as processesd.
Note - A common mistake that is made is that the change pointers are read, some filtering is done for specific ones that should be extracted and then only the extracted ones have their change pointer status updated. It's important to update the status on all of the change pointers because otherwise they'll be picked up again on the next run of the program and will be filtered out again, so over time the number of selected change pointers will keep growing since they will never get purged from the change poitner tables.
Note that the BDCP and BDCPS tables have a number of performance issues when the selections are done against them due to the way they are joined and the crieteria that is used for selecting. Becuase of this SAP has implimented a new change pointer table BDCP2 which is a single table as opposed to using a join. In order to utilize BDCP2:
- Used SM30 to update V_TBDME. For your message type turn on the checkbox for BDCP2.
- Run program RBDCPMIG for your message type, this will migrate existing pointers over to the BDCP2 table. If you can guarentee that there are no existing pointers then you can use SM30 to update for your message type the target of the pointers as being BDCP2
~Ian
Maybe you are looking for
-
5th Gen iPod - Accidently Cut and Pasted in My Computer... Now Buggered
So, I was at school, listening to my music as per normal, when class ended and I had to leave. I closed iTunes before ejecting the iPod and didn't want to log off Windows without taking the iPod out first (being as its new and I love it so). I went t
-
Dng and CR2 files display as icons in CS5
Now I have installed CS5 on three machines - a new installation on WIN7, and here everything is alright - no problem! Two machines running XP wth a previous CS4 installation uninstalled show up in Bridge with this problem: dng and CR2 files display a
-
Dropped lumia 520 in water and it wont turn on
One week ago I dropped my phone in fresh water and it was completely submersed for about 2-3 minutes. I put it in a bag of uncooked rice for a couple of days and when I took it out it worked perfectly fine. However when it died I could not charge the
-
Internal Order Settlement-urgent
Hi Gurus I have an internal order balance of -160$ USD. USD is the Controlling Area Curr. But when viewed in local Curr (CAD) it has a balance of zero. I checked the controlling area settings, and it is set to update local aswell as contr. area curr.
-
Route Leaking between VRF:s (Shared services)
Hi, I'm a bit confused by this setup that i'm trying to achieve. The setup is classic though, I have one VRF for education (EDU), one for administrators (ADM) and then a shared VRF (GEM) like this: ip vrf ADM description *** ADMIN NET *** rd 2:2 expo