Regarding sample code to update partner function using SD_PARTNER_UPDATE
Hi All,
Please provide some sample code to update/add partner function using FM 'SD_PARTNER_UPDATE'.
regards
Vishnu
A better option would be to use a break point on this FM while creating a sales order. That way you will know how standard uses this FM.
Thanks,
Vikram.M
Similar Messages
-
Update partner function using DEBMAS06
Hi
I am using DEBMAS06 to add partner to partner function of a customer. As I need to update only the partners i am passing partner no and partner function to e1knvpm segment.
But the Idoc actually tries to delete the existing partners of the customer.
I just want to add a new partner.no1 answered
-
Update partner function in KNVP table using FM sd_customer-maintain_all
Hi All,
I have to update Partner Function PARVW in KNVP table using FM sd_customer_maintain_all.
I had already created a BDC program for updating which is running successfully.
But my requirement is to create a BAPI using FM customermaintain_all.
Ex: Tcode VD02
KUNNR PARVW KUNN2
Old data 123 Z1 70006666
123 Z2 70007777
Req. output 123 Z1 70006666
123 Z1 70007777
PARVW Z2 should not exist after updation.
When updating, I am getting the error message to my inbox as
Error Info... F2 802: System error in table KNVP
The above error is triggered while committing work after execution of SD_CUSTOMER_MAINTAIN_ALL.
The options I tried while looping at internal table containing kunnr, parvw & kunn2
CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'
EXPORTING
I_KNA1 = w_kna1
I_KNB1 =
I_KNVV = w_knvv
I_BAPIADDR1 =
I_BAPIADDR2 =
I_MAINTAIN_ADDRESS_BY_KNA1 = ' '
I_KNB1_REFERENCE = ' '
I_FORCE_EXTERNAL_NUMBER_RANGE = ' '
I_NO_BANK_MASTER_UPDATE = ' '
I_CUSTOMER_IS_CONSUMER = ' '
I_RAISE_NO_BTE = ' '
PI_POSTFLAG = 'X'
PI_CAM_CHANGED = ' '
PI_ADD_ON_DATA =
I_FROM_CUSTOMERMASTER = ' '
IMPORTING
E_KUNNR =
O_KNA1 =
E_SD_CUST_1321_DONE =
TABLES
T_XKNAS =
T_XKNBK =
T_XKNB5 =
T_XKNEX =
T_XKNVA =
T_XKNVD =
T_XKNVI =
T_XKNVK =
T_XKNVL =
T_XKNVP = I_XKNVP
T_XKNZA =
T_YKNAS =
T_YKNBK =
T_YKNB5 =
T_YKNEX =
T_YKNVA =
T_YKNVD =
T_YKNVI =
T_YKNVK =
T_YKNVL =
T_YKNVP = i_yknvp ***
T_YKNZA =
T_UPD_TXT =
EXCEPTIONS
CLIENT_ERROR = 1
KNA1_INCOMPLETE = 2
KNB1_INCOMPLETE = 3
KNB5_INCOMPLETE = 4
KNVV_INCOMPLETE = 5
KUNNR_NOT_UNIQUE = 6
SALES_AREA_NOT_UNIQUE = 7
SALES_AREA_NOT_VALID = 8
INSERT_UPDATE_CONFLICT = 9
NUMBER_ASSIGNMENT_ERROR = 10
NUMBER_NOT_IN_RANGE = 11
NUMBER_RANGE_NOT_EXTERN = 12
NUMBER_RANGE_NOT_INTERN = 13
ACCOUNT_GROUP_NOT_VALID = 14
PARNR_INVALID = 15
BANK_ADDRESS_INVALID = 16
TAX_DATA_NOT_VALID = 17
NO_AUTHORITY = 18
COMPANY_CODE_NOT_UNIQUE = 19
DUNNING_DATA_NOT_VALID = 20
KNB1_REFERENCE_INVALID = 21
CAM_ERROR = 22
OTHERS = 23.
IF sy-subrc eq 0.
Commit work and wait.
Endif.
All above tables have a field called KZ which has options
U-update
D-delete
I-insert
E- (I dont know)
Ex: T_XKNVP structure = KNVP Structure + Field KZ.
Documentation for this FM is not Available in English or German
1. I tried sending Z2 KZ as D first & Z1 with KZ as I with business partner of Z2 (KUNN2)
as single update.
Ex: T_XKNP table
KUNNR PARVW KUNN2 KZ
123 Z2 70007777 D
123 Z1 70007777 I
2. I tried it as a separate delete record and insert record i.e calling the FM twice .
3. I tried passing table T_YKNVP with old partner data + TXKNVP table new partner data
Ex: T_YKNP table
KUNNR PARVW KUNN2 KZ
123 Z2 70007777 U or space (I tried both one after another)
4. All combinations for field KZ are tried.
Please help me to overcome this problem.
I ) I need which parameters are to be passed to FM for updating partner function in KNVP table .
II) Do I need to pass structure I_KNA1 or I_KNVV to FM ? (Blank or with values corresponding to
partner function ).
III) Any sample code which can guide me.
Even a small hint or clue from you will certainly help me.
Thanks in Advance.
AJAXi have the same problem. I need to update the partner function PARVW thru a program that i created. I tried to use this FM but it didn't work. Anyone knows another FM that i can use to update the KNVP table?
-
Problem in update PO's partner function using BAPI_PO_CHANGE
Hi All,
I have some problem when i try to update PO partner function using BAPI_PO_CHANGE.
If i update partner function where business partner number is vendor (eg. GS) , it run successfully. But when I try to update partner function where business partner number is personnel number (eg. CS, VW, etc) , it was failed. And BAPI return message is "Please enter a partner role".
Please advice.
ThanksHi,
are you executing BAPI_TRANSACTION_COMMIT after BAPI_PO_CHANGE?
Check this code for PO update..
PARAMETERS: p_ebeln LIKE ekko-ebeln.
DATA: t_poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE.
DATA: t_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.
DATA: t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
t_poitem-po_item = '00010'.
t_poitem-net_price = '17.00'.
APPEND t_poitem.
t_poitemx-po_item = '00010'.
t_poitemx-net_price = 'X'.
t_poitemx-po_itemx = 'X'.
APPEND t_poitemx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = p_ebeln
TABLES
return = t_return
poitem = t_poitem
poitemx = t_poitemx.
COMMIT WORK.
<b>Reward points</b>
Regards -
Sample code to connect LDAP server using jndi
Hi,
can any one help me with sample code to connect LDAP server using jndi,
like i want to make use of Ldap server for serching Active directoty.
Thanks in advance,
Regards
MuthuYou can set ldap_auth=none for anonymous user.
User/password is mandatory otherwise. Please refer to http://docs.oracle.com/cd/E21764_01/integrate.1111/e12644/appendix_ldap_driver.htm#CHDHCABH
Thansk, -
How to update partner function in PO.
Hi guys,
Please help me, How to update partner function in PO.(Transaction ME23N),BAPI_PO_CHANGE is not updating this.it gives error like partner roles not change.DATA : li_return TYPE TABLE OF bapiret2 WITH HEADER LINE,
li_popartner TYPE TABLE OF bapiekkop WITH HEADER LINE,
lv_error TYPE FLAG .
li_popartner-partnerdesc = X1.
li_popartner-langu = sy-langu.
li_popartner-buspartno = 'vendor1'.
APPEND li_popartner.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = ebeln
TABLES
return = li_return
popartner = li_popartner.
LOOP AT li_return.
WRITE / li_return-message.
Check error
IF li_return-type = lc_E OR li_return-type = lc_A.
lv_error = 'X'.
ENDIF.
ENDLOOP.
IF lv_error IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
Is there any config issues are there And also I am going to pass any values .
HI,
How to update the confirmation tab in PO item level.
I write this code tell me i am going to pass any values or not.
DATA:
li_ekes TYPE STANDARD TABLE OF uekes .
CALL FUNCTION 'ME_CONFIRMATION_UPDATE'
EXPORTING
I_EBELN = lwa_z1confirmations-ebeln
TABLES
XEKES = li_ekes.
IF sy-subrc EQ 0.
ENDIF. -
Code to update a table using sqlldr
Hi all,
can anybody give the code to update a table using sqlldr with an example
thank youYou want add the new line and modified the existing line (based on empno) from file e:\scripts\sql\emp2_ext.dat into table emp2 :
7782,CLARK,MANAGER,7839,09/06/81,80000,,10
8000,ORACLE,DATABASE,,11/02/07,99999,,20Then :
SQL> conn system/mypwd
Connected.
SQL>
SQL> create directory my_dir as 'e:\scripts\sql';
Directory created.
SQL>
SQL> grant read,write on directory my_dir to scott;
Grant succeeded.
SQL>
SQL> conn scott/mypwd
Connected.
SQL> create table emp2_ext
2 (EMPNO NUMBER(4),
3 ENAME VARCHAR2(10),
4 JOB VARCHAR2(9),
5 MGR NUMBER(4),
6 HIREDATE DATE,
7 SAL NUMBER(7,2),
8 COMM NUMBER(7,2),
9 DEPTNO NUMBER(2)
10 )
11 ORGANIZATION EXTERNAL
12 ( TYPE ORACLE_LOADER
13 DEFAULT DIRECTORY my_dir
14 ACCESS PARAMETERS
15 ( records delimited by newline
16 badfile my_dir:'emp2_ext.bad'
17 logfile my_dir:'emp2_ext.log'
18 fields terminated by ','
19 missing field values are null
20 ( empno, ename, job, mgr, hiredate char date_format date mask "dd/mm/yy",
21 sal, comm, deptno
22 )
23 ) LOCATION ('emp2_ext.dat')
24 ) ;
Table created.
SQL>
SQL> select * from emp2_ext;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/81 80000 10
8000 ORACLE DATABASE 11/02/07 99999 20
SQL> select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/81 24500 10
7839 KING PRESIDENT 17/11/81 50000 10
7934 MILLER CLERK 7782 23/01/82 13000 10
SQL> merge into emp2 a
2 using (select * from emp2_ext) b
3 on (a.empno=b.empno)
4 when matched then update set a.ename=b.ename,
5 a.job=b.job,
6 a.mgr=b.mgr,
7 a.hiredate=b.hiredate,
8 a.sal=b.sal,
9 a.comm=b.comm,
10 a.deptno=b.deptno
11 when not matched then insert (a.empno, a.ename, a.job, a.mgr, a.hiredate, a.sal, a.comm, a.deptno)
12 values (b.empno, b.ename, b.job, b.mgr, b.hiredate, b.sal, b.comm, b.deptno);
2 rows merged.
SQL>
SQL> select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/81 80000 10 --modified line
7839 KING PRESIDENT 17/11/81 50000 10
7934 MILLER CLERK 7782 23/01/82 13000 10
8000 ORACLE DATABASE 11/02/07 99999 20 --added line
SQL> HTH,
Nicolas.
Well, Hans has already give good explanation with docs links...
Message was edited by:
N. Gasparotto -
How to update partner functions in customer master
Hi all,
I want to update the partner functions for the customer master using transaction code XD02. I created the LSMW by means of recording but it doesn't work because the partner functions for the customer changes.
for example , certain customers have shipto paty, sold to party , bill to party payer and forwarding agent. some customers wont have all the above mentioned category.they may have only ship to party, sold to paty & bill to party.
Is there any other alternative way to update the partner functions for the customer.
Regards,
A.RathinaprakashHi A.Rathinaprakash,
Please use the FM 'SD_CUSTOMER_MAINTAIN_ALL' to maintain the partner functions in the customer.
Pass the partner details in the TABLES parameter T_XKNVP.
Regards
Chetan -
Sample code in Update Rule to restrict data selection?
We used to restrict data selection in InfoPackage data selection, e.g., for company code range when loading data from a source system (e.g. EBP which is similar to R3), but somehow the company code range we set in InfoPackage data selection not working and we found actually it occurs on the source system side when running RSA3 on EBP side and input the company code range in RSA3 selection section, but still it extracts data beyond the company code range. We don't understand why EBP data selection doesn't work, then we consider in update rule on BW to set the company code range. We know in update rule, we can select Start Routine, formula, or routine to set the company code range. But we would be appreciated if experts here can recommend which one is the most efficient to load data fast for data load performance reason and would be appreicated if you can let us know the sample code!
Thanks in advance!hi Hari,
I copy the whole code of the start routine below:
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: ...
Includes to update generic objects
INCLUDE rsbctgn_top .
INCLUDE rsbctgn_update_rules .
INCLUDE rsbctbbp_generic_objects.
The following section is prepared for you if you compound
the business partner 0BPARTNER with the
Source System 0BBP_SYS_BP or if you compound the organizational
Unit 0ORGUNIT with the source System 0BBP_SYS_BP
TYPE-POOLS: RRSV.
Data: L_HLP_CHAVL_CMP TYPE RSCHAVL.
DATA:
L_S_DEP TYPE RRSV_S_DEP,
L_T_DEP TYPE RRSV_T_DEP.
End of compound
DATA: l_s_errorlog TYPE rssm_s_errorlog_int,
l_hlp_chavl TYPE rschavl.
$$ end of global - insert your declaration only before this line -
The follow definition is new in the BW3.x
TYPES:
BEGIN OF DATA_PACKAGE_STRUCTURE.
INCLUDE STRUCTURE /BIC/CS0BBP_CONF_TD_1.
TYPES:
RECNO LIKE sy-tabix,
END OF DATA_PACKAGE_STRUCTURE.
DATA:
DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
FORM startup
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
DATA_PACKAGE STRUCTURE DATA_PACKAGE
USING RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line -
fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
to make monitor entries
delete data_package where 0comp_code < 'X300' OR 0comp_code > 'X6ZZ'.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM. -
Update partner function before saving Customer (XD01/XD02)
Hello Experts,
I need to update my partner function table in Sales Area Data of Customer Master (XD01/XD02)
before saving the customer. Is there any exit where I can do that.
I tried using Enhancement SAPMF02D. Exit - EXIT_SAPMF02D_001. Where I modified the table T_KNVP. But, it again defaults to its original value.
Any help is appreaciated.
Regards,
DNPI rephrase the question -
I can do an update after a Customer is created but is it possible to trigger a program everytime after a Customer(XD01/XD02) is being created.
Regards,
DNP -
BAPI_EQUI_CHANGE - Update Partner Function
Hello,
We are trying to update equipment partner function by using BAPI_EQUI_CHANGE, but its not happening.
Please provide your valuable inputs on this.
Thanks,
Amit.Hi,
I think these will work for your scenario,
BAPI_BPCONTACT_CHANGE
SD_SALES_PARTNER_MAINTAIN.
Regards,
Ravi shankar -
Sample code creating BOM for CS01 using BDC recording.
Hi,
Can anyone give me sample coding creating BOM for CS01 using BDC recording.
I want to display the flat file records,under one (Alternative BOM).
I m already working on it,but i m getting one A.BOM for each records.
[ Header data ] [ Item Data ]
SOFTDRINKS WIND 1 13 1 ml l
SOFTDRINKS WIND 1 11 1 ml l
SOFTDRINKS WIND 1 15 1 ml l
SOFTDRINKS WIND 1 14 1 ml l
Code:
report ZBOM
no standard page heading line-size 255.
*include bdcrecx1.
*DATA: BEGIN OF bdc OCCURS 0,
matnr(18),
werks(4),
stlan(1),
END OF BDC.
*DATA: BEGIN OF BDC1 OCCURS 0,
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
posnr(4),
END OF bdc1.
DATA: BEGIN OF BDCDATA OCCURS 0,
matnr(18),
werks(4),
stlan(1),
idnrk(18),
MENGE(18),
MEINS(3),
postp(1),
posnr(4),
END OF BDCDATA.
data ibdcdata type standard table of bdcdata WITH header line.
*start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
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 = BDCDATA
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.
*perform open_group.
loop at bdcdata.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
'SOFTDRINKS'.
perform bdc_field using 'RC29N-WERKS'
'WIND'.
perform bdc_field using 'RC29N-STLAN'
'1'.
perform bdc_field using 'RC29N-DATUV'
'16.09.2008'.
perform bdc_dynpro using 'SAPLCSDI' '0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29K-BMENG'
'1'.
perform bdc_field using 'RC29K-STLST'
'1'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-EXSTL'.
perform bdc_dynpro using 'SAPLCSDI' '0111'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-LABOR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSTP(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_field using 'RC29P-IDNRK(001)'
BDCDATA-IDNRK.
perform bdc_field using 'RC29P-MENGE(001)'
BDCDATA-MENGE.
perform bdc_field using 'RC29P-MEINS(001)'
BDCDATA-MEINS.
perform bdc_field using 'RC29P-POSTP(001)'
BDCDATA-POSTP.
perform bdc_dynpro using 'SAPLCSDI' '0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR'.
perform bdc_field using 'RC29P-POSNR'
BDCDATA-POSNR. "'0010'.
perform bdc_field using 'RC29P-IDNRK'
BDCDATA-IDNRK. "'15'.
perform bdc_field using 'RC29P-MENGE'
BDCDATA-MENGE. "'1'.
perform bdc_field using 'RC29P-MEINS'
BDCDATA-MEINS. "'ml'.
perform bdc_dynpro using 'SAPLCSDI' '0131'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POTX1'.
perform bdc_field using 'RC29P-SANKA'
'X'.
*perform bdc_transaction using 'CS01'.
*perform close_group.
CALL TRANSACTION 'CS01' USING IBDCDATA MODE 'A' UPDATE 'S'.
REFRESH IBDCDATA.
clear ibdcdata.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR iBDCDATA.
iBDCDATA-PROGRAM = PROGRAM.
iBDCDATA-DYNPRO = DYNPRO.
iBDCDATA-DYNBEGIN = 'X'.
APPEND ibDCDATA .
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR iBDCDATA.
iBDCDATA-FNAM = FNAM.
iBDCDATA-FVAL = FVAL.
APPEND iBDCDATA .
ENDIF.
ENDFORM.Hi,
I tried with the sample code but i m not getting the required result.
Can anyone give some other soln.
Code:
REPORT ZBOM2
no standard page heading line-size 255.
*include bdcrecx1.
TYPES: BEGIN OF TY_FLAT, " structure for flat file
STRING(200),
END OF TY_FLAT.
TYPES: BEGIN OF TY_HEAD, " structure for header file
IND(2) TYPE N,
MATNR(18),
WERKS(4),
STLAN(1),
END OF TY_HEAD.
TYPES : BEGIN OF TY_ITEM, "structure for item file
IND(2) TYPE N,
POSTP(1),
IDNRK(18),
MENGE(13),
meins(3),
END OF TY_ITEM.
TYPES :BEGIN OF TY_FLAT1, " structure for final file
MATNR(18),
WERKS(4),
STLAN(1),
posnr(4),
POSTP(1),
IDNRK(18),
MENGE(13),
meins(3),
END OF TY_FLAT1.
INTERNAL TABLE DECLERATIONS:
DATA : T_FLAT TYPE STANDARD TABLE OF TY_FLAT,
T_FLAT1 TYPE STANDARD TABLE OF TY_FLAT1,
T_HEAD TYPE STANDARD TABLE OF TY_HEAD,
T_ITEM TYPE STANDARD TABLE OF TY_ITEM,
T_BDCDATA TYPE STANDARD TABLE OF BDCDATA with header line ,
T_BDCMSG TYPE STANDARD TABLE OF BDCMSGCOLL.
WORK AREA DECLERATIONS:
DATA : ST_FLAT TYPE TY_FLAT,
ST_FLAT1 TYPE TY_FLAT1,
ST_HEAD TYPE TY_HEAD,
ST_ITEM TYPE TY_ITEM,
ST_BDCDATA TYPE BDCDATA,
ST_BDCMSG TYPE BDCMSGCOLL.
VARIABLES:
DATA : FNAM TYPE LOCALFILE, "rlgrap-filename,
FTYP TYPE RLGRAP-FILETYPE,
LF_FNAM TYPE STRING.
DATA : V_IND(2) TYPE N, " value 1,
V_FLD(20),
V_NO(2) TYPE N.
*start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\dilipkumar.b\Desktop\soft.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ','
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 = T_FLAT
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.
LOOP AT T_FLAT INTO ST_FLAT.
SPLIT ST_FLAT AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
INTO ST_FLAT1-MATNR ST_FLAT1-WERKS
ST_FLAT1-STLAN ST_FLAT1-POSTP
ST_FLAT1-IDNRK ST_FLAT1-MENGE ST_FLAT1-MEINS.
APPEND ST_FLAT1 TO T_FLAT1.
CLEAR ST_FLAT1.
ENDLOOP.
SORT T_FLAT1 BY MATNR WERKS STLAN POSTP IDNRK MENGE MEINS.
LOOP AT T_FLAT1 INTO ST_FLAT1.
MOVE :
ST_FLAT1-MATNR TO ST_HEAD-MATNR,
ST_FLAT1-WERKS TO ST_HEAD-WERKS,
ST_FLAT1-STLAN TO ST_HEAD-STLAN,
ST_FLAT1-POSTP TO ST_ITEM-POSTP,
ST_FLAT1-IDNRK TO ST_ITEM-IDNRK,
ST_FLAT1-MENGE TO ST_ITEM-MENGE,
ST_FLAT1-MENGE TO ST_ITEM-MEINS.
AT new STLAN.
ADD 1 TO V_IND.
ENDAT.
MOVE V_IND TO ST_HEAD-IND.
MOVE V_IND TO ST_ITEM-IND.
APPEND ST_HEAD TO T_HEAD.
APPEND ST_ITEM TO T_ITEM.
CLEAR ST_HEAD.
CLEAR ST_ITEM.
ENDLOOP.
CLEAR V_IND.
*perform open_group.
SORT T_ITEM BY IND.
SORT T_HEAD BY IND.
DELETE ADJACENT DUPLICATES FROM T_HEAD.
LOOP AT T_HEAD INTO ST_HEAD.
perform bdc_dynpro using 'SAPLCSDI' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-STLAN'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29N-MATNR'
ST_HEAD-MATNR.
perform bdc_field using 'RC29N-WERKS'
ST_HEAD-WERKS.
perform bdc_field using 'RC29N-STLAN'
ST_HEAD-STLAN.
perform bdc_field using 'RC29N-DATUV'
'16.09.2008'.
perform bdc_dynpro using 'SAPLCSDI' '0110'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RC29K-BMENG'
'1'.
perform bdc_field using 'RC29K-STLST'
'1'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-EXSTL'.
perform bdc_dynpro using 'SAPLCSDI' '0111'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-LABOR'.
LOOP AT T_ITEM INTO ST_ITEM WHERE IND = ST_HEAD-IND.
ADD 1 TO V_NO.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29K-MENGE(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
perform bdc_field using 'RC29P-IDNRK(01)'
ST_ITEM-IDNRK.
perform bdc_field using 'RC29P-MENGE(01)'
ST_ITEM-MENGE.
perform bdc_field using 'RC29P-MEINS(01)'
ST_ITEM-MEINS.
perform bdc_field using 'RC29P-POSTP(01)'
ST_ITEM-POSTP.
CONCATENATE 'RC29K-IDNRK(' V_NO ')' INTO V_FLD.
CONDENSE V_FLD.
PERFORM BDC_FIELD USING V_FLD
ST_ITEM-IDNRK.
CONCATENATE 'RC29K-MENGE(' V_NO ')' INTO V_FLD.
CONDENSE V_FLD.
PERFORM BDC_FIELD USING V_FLD
ST_ITEM-MENGE.
CONCATENATE 'RC29K-MEINS(' V_NO ')' INTO V_FLD.
CONDENSE V_FLD.
PERFORM BDC_FIELD USING V_FLD
ST_ITEM-MEINS.
CONCATENATE 'RC29K-POSTP(' V_NO ')' INTO V_FLD.
CONDENSE V_FLD.
PERFORM BDC_FIELD USING V_FLD
ST_ITEM-POSTP.
V_NO = 1.
ENDLOOP.
CLEAR V_NO.
*perform bdc_dynpro using 'SAPLCSDI' '0130'.
*perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'BDC_CURSOR'
'RC29P-POSNR'.
*perform bdc_field using 'RC29P-POSNR'
POSNR.
*perform bdc_field using 'RC29P-IDNRK'
bdcdata-IDNRK.
*perform bdc_field using 'RC29P-MENGE'
bdcdata-MENGE.
*perform bdc_field using 'RC29P-MEINS'
bdcdata-MEINS.
perform bdc_dynpro using 'SAPLCSDI' '0131'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-POTX1'.
perform bdc_field using 'RC29P-SANKA'
'X'.
perform bdc_dynpro using 'SAPLCSDI' '0133'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RC29P-matkl'.
perform bdc_field using 'RC29P-SANKA'
'zv01'.
perform bdc_dynpro using 'SAPLCSDI' '0140'.
perform bdc_field using 'BDC_CURSOR'
'RC29N-POSNR(01)'.
perform bdc_field using 'BDC_OKCODE'
'=FCBU'.
*perform bdc_transaction using 'CS01'.
perform close_group.
CALL TRANSACTION 'CS01' USING t_bdcdata MODE 'A' UPDATE 'S'.
REFRESH t_bdcdata.
clear t_bdcdata.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR st_bdcdata.
st_bdcdata-PROGRAM = PROGRAM.
st_bdcdata-DYNPRO = DYNPRO.
st_bdcdata-DYNBEGIN = 'X'.
APPEND st_bdcdata to t_bdcdata .
ENDFORM.
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
CLEAR st_bdcdata.
st_bdcdata-FNAM = FNAM.
st_bdcdata-FVAL = FVAL.
APPEND st_bdcdata to t_bdcdata.
ENDIF.
ENDFORM. -
How to update partner function in ME_PROCESS_PO_CUST
Hi,
does anyone know how to update the partner function in PO? transaction ME22N or ME21N.
I have checked the BADI ME_PROCESS_PO_CUST and there is no way for me to set the partner.. there is a method get_partners but i didn't find a way to set it..
I cannot just modify the table EKPA since when creating PO, there is no PO number yet.
Can anyone help? Please.
ThanksHi Esaki,
1) Define new field selection in configuration "Define screen layout at Document level"
2) write code in fieldselection_item_refkeys as follow
get item data
if your condition
ch_key0 = new field selection
endif
Hope it can help u.
Grace -
Short Dump 'ASSERTION_FAILED' during updating partner Functions
Hi All,
I am updating the Partner Functions for the Customers using FM 'SD_CUSTOMER_MAINTAIN_ALL' and passing the partner functions and numbers to the XKNVP structure.
while running the program in am getting the short dump as ASSERTION_FAILED.
Detailed Description:
In the running application program, the ASSERT statement recognized a situation that should not have occurred.
The runtime error was triggered for one of these reasons:
- For the checkpoint group specified with the ASSERT statement, the activation mode is set to "abort".
- Via a system variant, the activation mode is globally set to "abort" for checkpoint groups in this system.
- The activation mode is set to "abort" on program level.
- The ASSERT statement is not assigned to any checkpoint group.
The Dump is occuring in the method 'get_cvic_cust_to_bp1_line'.
We have searched for a relevant SAP note but could not find any.
can any one please help to solve this issue?
Helpful answer will surely be rewarded.
Thanks in Advance,
Asif Ali KhanWhen you are (absolutely) sure you are using this function module in the correct way, only then opening a message for SAP is liable. However, most of the times this happens because not all (or all) parameters are not provided for the FM to work properly, or what ever reason that may be.
It might be helpful to determine the checkpoint group and have a look at the log in transaction SAAB. This might give you a clue as to where the problems lies. -
LSMW, CREMAS04, and updating Partner Functions
I am involved with converting legacy data into SAP. To populate the SAP Vendor Master correctly will involve 3 passes using LSMW:
Pass #1: use IDOC CREMAS04 and populate the majority of master record fields
Pass #2: use BAPI: Business Object "BUS4001"; Method "SAVEREPLICA"; Message Type "ADRMAS"; Basic Type "ADRMAS03" to update Vendor record address data.
Pass #3: use IDOC CREMAS04 and update Head Office, Alternate Payee, and related Partner Function data.
The problem I am having is best explained using the following example:
When a vendor record (ex: Vendor Number 300004) is first created, the following 3 Partner Functions are also created automatically to reference the same vendor number: OA, VN, & PI (Ordering Address, Vendor, & Invoicing Party):
OA Ordering Address 300004 Vendor A
VN Vendor 300004 Vendor A
PI Invoicing Party 300004 Vendor A
This particular vendor is actually one of many "plants" or "warehouses" of a larger vendor, and I need to configure the record to reflect that the Purchase Orders go to the Parent Vendor (Head office) and that the Invoice comes from the same source. Therefore, I need to remove or edit the existing OA and PI partner functions so that I only end up with the same 3 Partner Functions, but the linked vendor record for partner functions OA and PI needs to be that of Head Office.
Example: if using Vendor Number 300005 "Head Office Vendor"
OA Ordering Address 300005 Vendor A
VN Vendor 300004 Vendor A
PI Invoicing Party 300005 Vendor A
What I am actually seeing when I post the IDOC is the following:
OA Ordering Address 300004 Vendor A
OA Ordering Address 300005 Vendor A
VN Vendor 300004 Vendor A
PI Invoicing Party 300004 Vendor A
PI Invoicing Party 300005 Vendor A
Can anyone shed some light on this?Don,
I am trying to work with the same data that you discussed in this thread. Can you send me some additional details on your Pass #2? I was successful in Pass #1, particularly in adding new PI vendors when necessary and deleting the existing internally created PI vendors. But I'm stuck on Pass #2 where I want to add the extended address information that you mention using the SAVEREPLICA BAPI. I can certainly use the recording method, but would like to leverage the power of the BAPI approach.
Thanks in advance!
Wes
Maybe you are looking for
-
Panasonic PV-GS320: worth the extra $?
Any thoughts on this camcorder? Does it have analog in to convert old 8mm to miniDV? Thanks!
-
Hi, I am trying to migrate the MedRec Application available with BEAWeblogin to SAP WAS. While deploying the .ear file i am getting com.sap.engine.services.servlets_jsp.server.exceptions.WebIOException The details are as follows: Caused by: com.sap.e
-
How can i get flex_sdk_4.0.0.10485.zip?
2years ago, i completed a project with flex_sdk_4.0.0.10485.zip. today , i want to reuse the project , but i can't get the flex_sdk_4.0.0.10485.zip, the source code can't complite correctly. thank you ! the url "http://fpdownload.adobe.com/pu
-
Strobe Media Playback requires FMS, HTTP origin
I want to know that Strobe Media Playback (that uses OSMF 2.0) requires FMS, HTTP Origin and f4fpackager (all of them or any) as server side support for the Dynamic Streaming Sample application, (OSMF Sample Players given in the OSMF Sample Folder)
-
So you either like, loath or find it indifferent.......but Is Premiere and other Adobe software so bug free that they can afford wasting time and effort of Adobe staff in changing a forum that was not broken? Adobe you have your priorities wrong. Min