Hr...bdc for pa40-salary increment
HI FRIENDS..
M NOT ABLE TO FETCH VALUES FOR TABLE CONTORL IN PA40 T.CODE FOR SALARY INCREMENT..
ACT D PROBLEM IS..
THE OLD SALARY SRTUCTURE IS DIFFERENG FROM CURRENT SALARY STRUCTURE IN EXCEL SHEET..
DOES ANY1 HAVE THE BDC FOR SALARY INCREMENT ..?
PLS HELP..
PTS REWRDED FOR SURE..
Hi,
We never write BDC for PA40.
Write it for PA30.
Goto SHDB tcode and record for the required infotype.
Or you can also use any of the following FM instead of BDc.
HR_INFOTYPE_OPERATION
HR_MAINTAIN_MASTERDATA.
Refer
https://forums.sdn.sap.com/click.jspa?searchID=4208189&messageID=3188548
https://forums.sdn.sap.com/click.jspa?searchID=4208189&messageID=1552901
Regards
Similar Messages
-
hi
i am going to make bdc program for pa40 which is of hr module .
i want to know whether bdc program will be similar or different for hr module .
regards
Rakesh singhhi rakesh,
check this out....
*include bdcrecx1.
TABLES: t100.
Type Declaration *
TYPES : BEGIN OF t_pa40,
*----INFO TYPE 0000
pernr TYPE bapip0001-pernr, "EMPLOYEE NUMBER
einda TYPE dats,
begda(10) TYPE c, "start date
plans(8) TYPE c, "POSITION
massn(2) TYPE c, "Action Type
massg(2) TYPE c, "reason for action
werks(4) TYPE c, "PERSONAL AREA
persg(1) TYPE c, "EMPLOYEE GROUP
persk(2) TYPE c, "Employee Subgroup
*----INFO TYPE 0002
anrex(5) TYPE c, "Form of address text
nachn(40) TYPE c, "Last Name
vorna(40) TYPE c, "FIRST NAME
inits(10) TYPE c, "INITIALS
gesch(1) TYPE c, "gender key
gbdat(10) TYPE c, "DATE OF BIRTH
fatxt(1) TYPE c, "MARITAL STATUS,
famdt(10) TYPE c, "DATE OF MARRIAGE,
*----INFO TYPE 0001
btrtl(4) TYPE c, "Personnel Subarea
gsber(4) TYPE c, "Business Area
abkrs(2) TYPE c, "Payroll Area
*----INFO TYPE 0006
anssa(4) TYPE c, "ADDRESS TYPE
stras(60) TYPE c, "STREET
locat(40) TYPE c, "2nd LINE ADDRESS
pstlz(10) TYPE c, "POSTAL CODE
ort01(40) TYPE c, "City
telnr(14) TYPE c, "Telephone number
*----INFO TYPE 0007
schkz(8) TYPE c, "Work Schedule Rule
*----INFO TYPE 0008
trfar(2) TYPE c, "PAY SCALE TYPE,
trfgb(2) TYPE c, "PAY SCALE AREA
divgv(5) TYPE c, "Hours worked per payroll period
trfgr(8) TYPE c, "Pay Scale Group
trfst(2) TYPE c, "level
*----EMPLOYEE WAGE_TYPES
lga01(4) TYPE c, "Wage type-----LINE ITEM 1(5000)
lga02(4) TYPE c, "Wage type-----LINE ITEM 2(5010)
lga03(4) TYPE c, "Wage type-----LINE ITEM 3(5020)
lga04(4) TYPE c, "Wage type-----LINE ITEM 4(5030)
lga05(4) TYPE c, "Wage type-----LINE ITEM 5(5040)
*----EMPLOYEE WAGE AMOUNTS
bet01(13) TYPE c, "Wage Type Amount for Payments
bet02(13) TYPE c, "Wage Type Amount for Payments
bet03(13) TYPE c, "Wage Type Amount for Payments
bet04(13) TYPE c, "Wage Type Amount for Payments
bet05(13) TYPE c, "Wage Type Amount for Payments
*----INFO TYPE 0009
bankl(15) TYPE c, "BANK KEY
bankn(18) TYPE c, "BANK ACCOUNT NUMBER
zlsch(1) TYPE c, "Payment Method,
*----info-587,588,185.
tstid(4) TYPE c, "PF TRUST ID
penid(4) TYPE c, "PENSION TRUST ID
eepfn(20) TYPE c, "PF NUMBER,
eepnn(20) TYPE c, "PENSION NUMBER
eevpf(5) TYPE c, "Voluntary Provident fund
evpfa(15) TYPE c, "Employee VPF Amount
pnflg(1) TYPE c, "Contribution for Pension scheme flag
ptxel(1) TYPE c, "Eligibility for PTax
ictyp LIKE p0185-ictyp, "Id Type
icnum LIKE p0185-icnum, "ID NUMBER
auth1 LIKE p0185-auth1, "Author
END OF t_pa40.
Internal table declaration *
DATA : i_pa40 TYPE TABLE OF t_pa40 WITH HEADER LINE.
bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
data definition
Batchinputdata of single transaction
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
messages of call transaction
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
error session opened (' ' or 'X')
DATA: e_group_opened.
message texts
DATA: l_mstring(480).
DATA: l_subrc LIKE sy-subrc.
Variables Declaration *
DATA: v_fname TYPE string,
v_ftype(10) TYPE c VALUE 'ASC'.
Constants Declaration *
CONSTANTS: m1 VALUE 'E',
u1 VALUE 'S'.
Selection screen *
PARAMETERS: p_fname TYPE rlgrap-filename.
For F4 *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_fname.
start of selection *
START-OF-SELECTION.
MOVE p_fname TO v_fname.
GUI uploading *
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_fname
filetype = v_ftype
has_field_separator = 'X'
TABLES
data_tab = i_pa40.
LOOP AT i_pa40.
REFRESH bdcdata.
*perform open_group.
BDC recording *
PERFORM bdc_dynpro USING 'SAPMP50A' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'T529T-MNTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PICK'.
PERFORM bdc_field USING 'RP50G-PERNR'
i_pa40-pernr. "'77116'.
PERFORM bdc_field USING 'RP50G-EINDA'
i_pa40-einda. "'13.12.2007'.
PERFORM bdc_field USING 'RP50G-SELEC(01)'
'X'.
PERFORM bdc_dynpro USING 'MP000000' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'PSPAR-PERSK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'PSPAR-PERNR'
i_pa40-pernr. "' 77116'.
PERFORM bdc_field USING 'P0000-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0000-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'P0000-MASSN'
i_pa40-massn. "'01'.
PERFORM bdc_field USING 'P0000-MASSG'
i_pa40-massg. "'01'.
PERFORM bdc_field USING 'PSPAR-PLANS'
i_pa40-plans. "'99999999'.
PERFORM bdc_field USING 'PSPAR-WERKS'
i_pa40-werks. "'1000'.
PERFORM bdc_field USING 'PSPAR-PERSG'
i_pa40-persg. "'1'.
PERFORM bdc_field USING 'PSPAR-PERSK'
i_pa40-persk. "'01'.
PERFORM bdc_dynpro USING 'MP000200' '2040'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0002-NATIO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0002-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0002-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'Q0002-ANREX'
i_pa40-anrex. "'Mr'.
PERFORM bdc_field USING 'P0002-NACHN'
i_pa40-nachn. "'eng'.
PERFORM bdc_field USING 'P0002-VORNA'
i_pa40-vorna. "'lish'.
PERFORM bdc_field USING 'P0002-INITS'
i_pa40-inits. "'E'.
PERFORM bdc_field USING 'P0002-GESCH'
i_pa40-gesch. "'1'.
PERFORM bdc_field USING 'P0002-SPRSL'
'EN'.
PERFORM bdc_field USING 'P0002-GBDAT'
i_pa40-gbdat. "'19.09.1985'.
PERFORM bdc_field USING 'Q0002-FATXT'
i_pa40-fatxt. "'Marr.'.
PERFORM bdc_field USING 'P0002-NATIO'
'IS'.
PERFORM bdc_dynpro USING 'MP000100' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0001-ABKRS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0001-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0001-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'P0001-BTRTL'
i_pa40-btrtl. "'1010'.
PERFORM bdc_field USING 'P0001-GSBER'
i_pa40-gsber. "'0001'.
PERFORM bdc_field USING 'P0001-ABKRS'
i_pa40-abkrs. "'01'.
PERFORM bdc_field USING 'P0001-PLANS'
i_pa40-plans. "'99999999'.
PERFORM bdc_dynpro USING 'MP000600' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-TELNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0006-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0006-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'P0006-STRAS'
i_pa40-stras. "'vs homes'.
PERFORM bdc_field USING 'P0006-LOCAT'
i_pa40-locat. "'k nagar'.
PERFORM bdc_field USING 'P0006-PSTLZ'
i_pa40-pstlz. "'522006'.
PERFORM bdc_field USING 'P0006-ORT01'
i_pa40-ort01. "'gnt'.
PERFORM bdc_field USING 'P0006-LAND1'
'IN'.
PERFORM bdc_field USING 'P0006-TELNR'
i_pa40-telnr. "'2325161'.
PERFORM bdc_dynpro USING 'MP000600' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/ENXT'.
PERFORM bdc_dynpro USING 'MP000700' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0007-SCHKZ'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0007-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0007-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'P0007-SCHKZ'
i_pa40-schkz. "'CGEN'.
PERFORM bdc_field USING 'P0007-EMPCT'
' 100,00'.
PERFORM bdc_dynpro USING 'MP000800' '2040'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0008-TRFAR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0008-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0008-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'P0008-TRFAR'
i_pa40-trfar. "'01'.
PERFORM bdc_field USING 'P0008-BSGRD'
'100,00'.
PERFORM bdc_field USING 'P0008-TRFGB'
i_pa40-trfgb. "'01'.
PERFORM bdc_field USING 'P0008-DIVGV'
i_pa40-divgv. "'192,00'.
PERFORM bdc_field USING 'P0008-TRFGR'
i_pa40-trfgr. "'JRMGT'.
PERFORM bdc_field USING 'P0008-TRFST'
i_pa40-trfst. "'01'.
PERFORM bdc_field USING 'P0008-ANCUR'
'INR'.
PERFORM bdc_field USING 'Q0008-IBBEG'
'27.03.2008'.
PERFORM bdc_field USING 'P0008-WAERS'
'INR'.
PERFORM bdc_field USING 'Q0008-LGART(01)'
i_pa40-lga01. "'5000'.
PERFORM bdc_field USING 'Q0008-LGART(02)'
i_pa40-lga02. "'5001'.
PERFORM bdc_field USING 'Q0008-LGART(03)'
i_pa40-lga03. "'5002'.
PERFORM bdc_field USING 'Q0008-LGART(04)'
i_pa40-lga04. "'5020'.
PERFORM bdc_field USING 'Q0008-LGART(05)'
i_pa40-lga05. "'5021'.
PERFORM bdc_field USING 'Q0008-BETRG(01)'
i_pa40-bet01. "' 5000'.
PERFORM bdc_field USING 'Q0008-BETRG(02)'
i_pa40-bet02. "' 5001'.
PERFORM bdc_field USING 'Q0008-BETRG(03)'
i_pa40-bet03. "' 5002'.
PERFORM bdc_field USING 'Q0008-BETRG(04)'
i_pa40-bet04. "' 5020'.
PERFORM bdc_field USING 'Q0008-BETRG(05)'
i_pa40-bet05. "' 5021'.
PERFORM bdc_dynpro USING 'MP000900' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0009-ZLSCH'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0009-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0009-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'P0009-BNKSA'
'0'.
PERFORM bdc_field USING 'Q0009-EMFTX'
'lish eng'.
PERFORM bdc_field USING 'Q0009-BKPLZ'
'522006'.
PERFORM bdc_field USING 'Q0009-BKORT'
'gnt'.
PERFORM bdc_field USING 'P0009-BANKS'
'IN'.
PERFORM bdc_field USING 'P0009-BANKL'
i_pa40-bankl. "'ICIC0000011'.
PERFORM bdc_field USING 'P0009-BANKN'
i_pa40-bankn. "'1403711'.
PERFORM bdc_field USING 'P0009-ZLSCH'
i_pa40-zlsch. "'T'.
PERFORM bdc_field USING 'P0009-WAERS'
'INR'.
PERFORM bdc_dynpro USING 'MP002100' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/ENXT'.
PERFORM bdc_dynpro USING 'MP002100' '2040'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/ENXT'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_dynpro USING 'MP002800' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/ENXT'.
If pf no and Pension no are given, then irrespective of *
the flat file Contribution for Pension scheme flag must be checked *
IF i_pa40-eepnn NE ' ' AND i_pa40-pnflg EQ ' '.
PERFORM bdc_dynpro USING 'MP058700' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/ENXT'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
ELSE.
PERFORM bdc_dynpro USING 'MP058700' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0587-EVPFA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'UPD'.
PERFORM bdc_field USING 'P0587-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0587-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'P0587-TSTID'
i_pa40-tstid. "'RPF1'.
PERFORM bdc_field USING 'P0587-PENID'
i_pa40-penid. "'RPF1'.
PERFORM bdc_field USING 'P0587-EEPFN'
i_pa40-eepfn. "'XX/XXX/999999/999999'.
PERFORM bdc_field USING 'P0587-EEPNN'
i_pa40-eepnn. "'XXXXX/501'.
PERFORM bdc_field USING 'P0587-EEVPF'
i_pa40-eevpf. "'25'.
PERFORM bdc_field USING 'Q0587-EEPF2'
'X'.
PERFORM bdc_field USING 'P0587-EVPFA'
i_pa40-evpfa. "' 1250'.
PERFORM bdc_field USING 'Q0587-ERPF2'
'X'.
PERFORM bdc_field USING 'Q0587-ERPN1'
'X'.
PERFORM bdc_field USING 'P0587-PNFLG'
i_pa40-pnflg. "'X'.
ENDIF.
PERFORM bdc_dynpro USING 'MP058800' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/ENXT'.
PERFORM bdc_dynpro USING 'MP058800' '2000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0588-BEGDA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0588-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0588-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'Q0588-PTXEL'
i_pa40-ptxel. "'X'.
PERFORM bdc_dynpro USING 'MP018500' '2240'.
PERFORM bdc_field USING 'BDC_CURSOR'
'P0185-BEGDA'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=UPD'.
PERFORM bdc_field USING 'P0185-BEGDA'
i_pa40-begda. "'13.12.2007'.
PERFORM bdc_field USING 'P0185-ENDDA'
'31.12.9999'.
PERFORM bdc_field USING 'P0185-ICNUM'
i_pa40-icnum. "'AAAAA9999A'.
PERFORM bdc_dynpro USING 'SAPMP50A' '2000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/EBCK'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RP50G-PERNR'.
*perform bdc_transaction using 'PA40'.
CALL TRANSACTION 'PA40' USING bdcdata
MODE m1
UPDATE u1
MESSAGES INTO messtab.
Message Handling *
LOOP AT messtab.
SELECT SINGLE * FROM t100 WHERE sprsl = messtab-msgspra
AND arbgb = messtab-msgid
AND msgnr = messtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH messtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&' WITH messtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
WRITE: / messtab-msgtyp, l_mstring(250).
ELSE.
WRITE: / messtab.
ENDIF.
ENDLOOP.
Success Check *
if sy-subrc is initial.
write : i_pa40-pernr, 'is created'.
else.
write : i_pa40-pernr, 'is not cretaed'.
endif.
ENDLOOP.
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM bdc_field USING fnam fval.
IF fval <> '' .
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
Regards,
Arun. -
Creation of BDC for a part of process.
Hi,
We are creating a BDC for PA40 action. It has a series of Info Types which come one by one. Now our requirement is to skip the last Info Type and create a recording for the process. is this possible.
We require this as the last Info type is Pensions Fund GB, this takes us through all the old records before we can make a new entry and the number of old records for different employees is different, hence no standard recording is possible. Can anyone suggesta way forward.
Thank you,
Arpita AroraHi,
In BDC program, when you are running the loop for each employee,You initially check the number of record for that employee in It0071 in that loop itself.
in your code then write,
Do N times.
BDC recording to exit screen with OK_CODE = '/ENXT'
enddo.
This will be in the loop of each employee record.
Thanks,
Sutapa. -
Dear Friends ,
When i am running BDC for HR salary appraisal, then I am getting the message
"Entry 40 00 does not exist in T510A (check entry)"
and the entry in Pay scale Type and pay scale area is picking 00 by default while it should be
02 by text file ,
and I am not able to go forward .....
Regards,
Rihan
SAP-abaper.Sept 12. A day later
I haven't get any reply yet. Someone out there must have done something similar.
Kindly give me some suggestion where should I start looking.
According to the HCM book, I can use "Prepare Appraisal Docs with Restricted Templates" to prepare appraisals based on more than just organization unit.
The program is using LDB PCH, unlike PNP which can select different report category to default selection screen parameters.
I can add personnel area on it, but I don't how to ask the program to get objec with this personnel area.
Can someone give a SAP program that uses LDB PCH with additional selection options?
Many thanks in advance. -
Hi All,
I am going for a BDC in PA40 for hiring action.
Please guide me is it correct to go for BDC in PA40.
Thanks in advance.Hi Albert,
I can only agree with Samuel. The only correct way to "create" a new employee is to use batch input.
You can modify the infogroup by using your own user group. Thus you can reduce the number of infotypes (table T588D) to meet exactly your batch input demands.
Please note, that in batch input no dynamic actions will be processed.
Regards
CHRIS -
Any one Have done Salary increment in abaphr
Hi Experts,
I am doing salary increment report in abaphr.If any one has done that type of report,or any one having idea how to do, Please send it to immediately with code.
or other wise send sample code to refer and process according to our requirements.
Thanks & regards,
satishHi Satish,
Best PDF file to learn HR Programming
http://www.melayu.plus.com/SAP%20HR%20Programming.pdf
HR deals with the INFOTYPES which are similar to Tables in General ABAP.
There are different ways of fetching data from these infotypes.
There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
Infotypes for these areas are different from one another area.
storing of records data in each type of area is different
LDBS like PNP are used in HR programing.
Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
On the whole Normal ABAP is different from HR abap.
For Personal Admn the Infotypes start with PA0000 to PA1999
Time Related Infotypes start with PA2000 to PA2999.
Orgn related Infotypes start with HRP1000 to HRP1999.
All custom developed infotypes stsrat with PA9000 onwards.
In payroll processing we use Clusters like PCL1,2,3 and 4.
Instead of Select query we use PROVIDE and ENDPROVIDE..
You have to assign a Logical Database in the attributes PNP.
Go through the SAp doc for HR programming and start doing.
http://www.sapdevelopment.co.uk/hr/hrhome.htm
See:
http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
sites regarding hr-abap:
http://www.sapdevelopment.co.uk/hr/hrhome.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
http://www.atomhr.com/training/Technical_Topics_in_HR.htm
http://www.planetsap.com/hr_abap_main_page.htm
You can see some Standard Program examples in this one ...
http://www.sapdevelopment.co.uk/programs/programshr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
http://www.erpgenie.com/faq/hr.htm.
http://www.planetsap.com/hr_abap_main_page.htm
http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
These are the FAQ's that might helps you as well.
http://www.sap-img.com/human/hr-faq.htm
http://www.sapgenie.com/faq/hr.htm
http://www.planetsap.com/hr_abap_main_page.htm
http://www.atomhr.com/library_full.htm
HR Long texts Upload
Look at the below link
BDC - hr maintain text
HR
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
http://www.atomhr.com/training/Technical_Topics_in_HR.htm
http://www.planetsap.com/hr_abap_main_page.htm
you can see some Standard Program examples in this one..
http://www.sapdevelopment.co.uk/programs/programshr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
These are the FAQ's that might helps you
http://www.sap-img.com/human/hr-faq.htm
http://www.sapgenie.com/faq/hr.htm
http://www.erpgenie.com/faq/hr.htm.
www.sap-img.com
http://www.planetsap.com/hr_abap_main_page.htm
http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
http://www.sapfans.com/forums/viewtopic.php?p=498530&sid=d7ec5866e3fb26880da129de45ce79de
http://www.sapcookbook.com/preview_hr_questions.htm
http://www.atomhr.com/library_full.htm
http://www.sapdevelopment.co.uk/hr/hrhome.htm
http://www.planetsap.com/hr_abap_main_page.htm
http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci983590,00.html
http://www.allsaplinks.com/HRmaterial.html
http://www.allsaplinks.com/timemanagement.html
http://www.allsaplinks.com/payrollcompletefunctional.html
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/HRINF/HRINF.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYXXFORM/PYINT_FORMBUILDER.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMPA/BCBMTWFMPA.pdfhttp://help.sap.com/printdocu/core/Print46c/en/data/pdf/MYSAP/SR_HR.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
Re: New to ABAP HR Programming
http://www.planetsap.com/hr_abap_main_page.htm
<b>Kindly Reward Points If You Found The Reply Usefull<b>,
Cheers,
Chaitanya. -
BDC for multiple line items (VA01)
Hi Experts,
I create a BDC for VA01 transaction for single line item in that now i want to upload multiple line items also with o/p of total no. of records uploaded, no. of records posted and the no. of error records...
Can any body explain with sample code...Hi,
if the flat file is containing header and item records...
first split those records tooo two internal tables header and item..
Loop at header ...
process of recording steps for header....
Loop at item...
here create a varialbe with char 2 .. for index value....
process of item recording steps..
increment the index value by 1....
here u have to pass 'p+' OK_CODE..
Endloop ..(item)
Endloop...(header)
for more info goo through this link...
http://www.sap-img.com/bdc.htm
hope helpful
Raghunath.S -
BDC for ME22n vendor confirmation
i am facing problem while doing BDC for ME22N . i am going for itemwise vendor confirmation.
for first line item it is happening. but for 2nd line item it is not going.
any help?
this is my code. i guess some loop i have to add but where? can any body give idea?
REPORT ZMM_VC_UPLOAD.
TABLES : t100.
Internal table declaration *
DATA : BEGIN OF it_upload OCCURS 0,
index(4), "Index
EBELN(10), "PO number
EBELP(5), "line item PO
LIST(1), "item number
BSTAE(4), "Confirmation control key
EBTYP(2), "Confirmation Category
BSTAE(4), "Confirmation control key
LPEIN(1), "Category of delivery date
EEIND(10), "delivery date
MENGE(13), "QTY Quantity as per vendor confirmation
XBLNR(20), "ext doc
ERDAT(10), "doc date
er_message(100),
END OF it_upload.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
MSGDATA LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
*Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER: P_FILE LIKE IBIPPARMS-PATH OBLIGATORY. "to select a file.
SELECTION-SCREEN END OF BLOCK B1.
*Initialization
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE .
PERFORM GET_FILENAME.
start-of-selection
START-OF-SELECTION.
PERFORM MAKE_FILE_NAME .
PERFORM UPLOAD_FILE.
PERFORM BDC_PROCESS.
perform read_messages.
*& Form UPLOAD_FILE
FORM UPLOAD_FILE .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = IT_UPLOAD .
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " UPLOAD_FILE
*& Form bdc_process
FORM BDC_PROCESS .
loop at it_upload.
LOOP AT IT_header.
refresh bdcdata.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=MECHOB'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'DYN_6000-LIST'
it_upload-list. "' 1'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1319-MATKL'.
perform bdc_field using 'MEPO1319-SPINF'
'X'.
perform bdc_dynpro using 'SAPLMEGUI' '0002'.
perform bdc_field using 'BDC_OKCODE'
'=MEOK'.
perform bdc_field using 'BDC_CURSOR'
'MEPO_SELECT-EBELN'.
perform bdc_field using 'MEPO_SELECT-EBELN'
it_upload-EBELN. "'4500195517'.
perform bdc_field using 'MEPO_SELECT-BSTYP_F'
'X'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=TABIDT14'.
perform bdc_field using 'BDC_CURSOR'
'MEPO_TOPLINE-BSART'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'DYN_6000-LIST'
it_upload-list. "' 1'.
perform bdc_field using 'MEPO1319-SPINF'
'X'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE' "first time
'/00'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'DYN_6000-LIST'
it_upload-list. " ' 1'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1334-BSTAE'.
perform bdc_field using 'MEPO1334-BSTAE'
it_upload-BSTAE . "'0005'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
*loop at it_item where ebeln = it_upload-ebeln.
perform bdc_field using 'BDC_CURSOR'
'DYN_6000-LIST'.
perform bdc_field using 'DYN_6000-LIST'
it_upload-list. "' 1'.
perform bdc_field using 'MEPO1334-BSTAE'
it_upload-BSTAE. "'0005'.
perform bdc_field using 'BDC_CURSOR'
'EKES-ERDAT(01)'.
perform bdc_field using 'EKES-EBTYP(01)'
it_upload-EBTYP. "'vc'.
perform bdc_field using 'RM06E-LPEIN(01)'
it_upload-LPEIN. "'D'.
perform bdc_field using 'RM06E-EEIND(01)'
it_upload-EEIND. "'15.02.2009'.
perform bdc_field using 'EKES-MENGE(01)'
it_upload-MENGE. "'10'.
perform bdc_field using 'EKES-XBLNR(01)'
it_upload-XBLNR. "'inv 9'.
perform bdc_field using 'EKES-ERDAT(01)'
it_upload-ERDAT. "'15.02.2009'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=MESAVE'.
CALL TRANSACTION 'ME22N' USING BDCDATA MODE 'A' UPDATE 'A' MESSAGES INTO MSGDATA.
CLEAR: BDCDATA,BDCDATA[].
refresh BDCDATA.
ENDLOOP.
ENDFORM. " bdc_process
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> ''.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM. "BDC_FIELD
*To get file name *
FORM GET_FILENAME .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = P_FILE.
IF SY-SUBRC NE 0 .
WRITE : / 'Enter File Name'.
ENDIF.
ENDFORM. "GET_FILENAMEHi Dude,
When ur looping the item information , in your code ur
loop at it_item where ebeln = it_upload-ebeln.
perform bdc_field using 'BDC_CURSOR'
'DYN_6000-LIST'.
perform bdc_field using 'DYN_6000-LIST'
it_upload-list. "' 1'.
perform bdc_field using 'MEPO1334-BSTAE'
it_upload-BSTAE. "'0005'.
perform bdc_field using 'BDC_CURSOR'
'EKES-ERDAT(01)'.
perform bdc_field using 'EKES-EBTYP(01)'
it_upload-EBTYP. "'vc'.
perform bdc_field using 'RM06E-LPEIN(01)'
it_upload-LPEIN. "'D'.
perform bdc_field using 'RM06E-EEIND(01)'
it_upload-EEIND. "'15.02.2009'.
perform bdc_field using 'EKES-MENGE(01)'
it_upload-MENGE. "'10'.
perform bdc_field using 'EKES-XBLNR(01)'
it_upload-XBLNR. "'inv 9'.
perform bdc_field using 'EKES-ERDAT(01)'
it_upload-ERDAT. "'15.02.2009'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_OKCODE'
'=MESAVE'.
->(01) you have to replace to variable , and every loop pass increment the varialbe value with 1.
ex : -
V1 = 1.
loop at item.
perform bdc_data using 'xyz(V1)'
it_upload-variable.
V1 = V1 + 1.
endloop.
This is called as index , the table control fields are differ the field name by index only... -
Hi
Can any one tell me how to create <b>Generic BDC for transaction VK11 (Creating condition records)</b>
My actual requirement is like we need to create <b>condition record</b> for every material with all the condition types exist for that material for different key combinations . <b>A condition record for every material is to be created for different condition types and different key combinations where material MATNR is a key field .For example we need to create condition records dynamically for condition types ZPR0, ZCM0 etc.. for different key combinations where matnr is a key field .</b>
can anyone of you point out a way to me?
Thanks in advance
Shivakumarplease copy the program and use it
* Report to Upload the pricing condtion records for materials. *
* Program : ZSDR_PRICE_UPLOAD *
* Author : girish.
* Description: *
* This report Creat pricing condition records for materials *
* Tables Used : SELECT UPDATE INSERT DELETE *
* MVKE X *
* Input/Output Files: *
* Transactions called: *
* Includes: *
* Run Frequency - *
* Program History *
* Date Change No Change Request SAP Rel NSC Rel *
* Description *
* 4.6C *
REPORT zsdr_price_upload MESSAGE-ID zsdr_bdc_vk11 LINE-SIZE 150
LINE-COUNT 75 .
******Internal Table for Header Data.
TYPES : BEGIN OF type_header,
kschl LIKE konv-kschl,
vkorg LIKE vbak-vkorg,
vtweg LIKE komg-spart,
matnr LIKE mvke-matnr,
kbetr(11) TYPE c,
datab(10) TYPE c,
datbi(10) TYPE c,
END OF type_header.
****Internal Table for Item Level.
TYPES : BEGIN OF type_item,
kschl LIKE konv-kschl,
vkorg LIKE vbak-vkorg,
vtweg LIKE komg-spart,
matnr LIKE mvke-matnr,
kbetr(11) TYPE c,
datab(10) TYPE c,
datbi(10) TYPE c,
END OF type_item.
******Error Table For not found in MVKE.
TYPES : BEGIN OF type_error ,
kschl LIKE konv-kschl,
vkorg LIKE vbak-vkorg,
vtweg LIKE komg-spart,
matnr LIKE mvke-matnr,
kbetr LIKE konp-kbetr,
datab(10) TYPE c,
datbi(10) TYPE c,
text(100) TYPE c,
END OF type_error.
****For error Messages
TYPES : BEGIN OF type_mtab,
matnr LIKE mara-matnr,
msgtyp LIKE bdcmsgcoll-msgtyp,
msgid LIKE bdcmsgcoll-msgid,
msgnr LIKE bdcmsgcoll-msgnr,
text(100) TYPE c,
END OF type_mtab.
****Internal Table
TYPES: BEGIN OF type_mvke,
matnr LIKE mvke-matnr,
vkorg LIKE mvke-vkorg,
vtweg LIKE mvke-vtweg,
END OF type_mvke.
****Internal Table
TYPES : BEGIN OF type_tvkov,
vkorg LIKE tvkov-vkorg,
vtweg LIKE tvkov-vtweg,
END OF type_tvkov.
** Declaring Internal Tables
DATA : t_header TYPE STANDARD TABLE OF type_header,
t_item TYPE STANDARD TABLE OF type_item,
t_mvke TYPE STANDARD TABLE OF type_mvke,
t_tvkov TYPE STANDARD TABLE OF type_tvkov,
t_error TYPE STANDARD TABLE OF type_error,
t_mtab TYPE STANDARD TABLE OF type_mtab.
** Work Area Declaration.
DATA : wa_header LIKE LINE OF t_header,
wa_item LIKE LINE OF t_item,
wa_error LIKE LINE OF t_error,
wa_mtab LIKE LINE OF t_mtab,
wa_tvkov LIKE LINE OF t_tvkov,
wa_mvke LIKE LINE OF t_mvke.
**Rows for Table with Excel Data********
DATA: t_xls_file LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
***Constant.
DATA : c_params LIKE ctu_params.
DATA : c_ans(1) TYPE c.
DATA : v_count(4) TYPE c. " To show No.of records
DATA : bdctab LIKE bdcdata OCCURS 10 WITH HEADER LINE. " BDCDATA
DATA : tmess_mtab LIKE bdcmsgcoll OCCURS 10 WITH HEADER LINE.
** SELECTION SCREEN
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK b1.
* END OF SELECTION SCREEN.
DATA : repid LIKE sy-repid.
DATA : v_matnr(50) TYPE c, "used for line items
v_kbetr(50) TYPE c, "used for line items
v_dat1(50) TYPE c, "used for line items
v_dat(50) TYPE c. "used for line items
DATA : v_lindx(5) TYPE n ,"index counter for first 14 records.
v_lindx1(5) TYPE n VALUE '01', "index counter for 13 records.
v_item(5) TYPE c, "To increment the line index
v_pgedwn2 TYPE i . "For Pagedown Counter
DATA: v_currentrow TYPE i. "For Current Row
DATA v_bdc(50) TYPE c." Text to apper in Confrim POPUP Window.
************AT SELECTION-SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
PERFORM get_filename USING p_fname.
*************START-OF-SELECTION
START-OF-SELECTION.
******Values for Ctu_params to Transaction
c_params-defsize = 'X'.
c_params-dismode = 'N'.
c_params-updmode = 'S'.
******Refresh
PERFORM f_refresh.
*********To upload File.
PERFORM upload_file.
****User Confrimation only BDC will Process
IF c_ans = '1'.
** *** BDC Process.
PERFORM read_data.
ELSE.
FORMAT COLOR 3 INTENSIFIED .
WRITE:/ 'Selected not to Process the Upload'.
EXIT.
ENDIF.
******On completion of Process Refresh the Internal Table
REFRESH : t_xls_file,
t_header,
t_item,
t_mvke,
t_tvkov.
CLEAR : t_xls_file,
wa_header,
wa_item,
wa_mvke,
wa_tvkov.
***********Display Messages
WRITE : /01 'Status',19 'Status Text'.
WRITE AT 0(150) sy-uline.
LOOP AT t_mtab INTO wa_mtab.
WRITE :/01 wa_mtab-msgtyp,19 wa_mtab-text.
ENDLOOP.
SKIP 2.
SORT t_error BY matnr.
WRITE AT 0(150) sy-uline.
WRITE 'ERROR MESSAGES'.
WRITE AT 0(150) sy-uline.
WRITE :/01 'Material.No',20 'Status Text'.
WRITE AT 0(150) sy-uline.
LOOP AT t_error INTO wa_error WHERE matnr NE ' '.
WRITE:/01 wa_error-matnr,20 wa_error-text.
ENDLOOP.
*& Form get_filename
* text
* -->P_FILENAME text
FORM get_filename USING p_fname.
*****To read the file from Presentation Server
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = repid
dynpro_number ! ; = syst-dynnr
field_name = p_fname
* STATIC = ' '
mask = '*.XLS'
CHANGING
file_name = p_fname
EXCEPTIONS
mask_too_long = 1
OTHERS = 2
IF sy-subrc <> 0.
* * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " get_filename
*& Form upload_file
* text
* --> p1 text
* <-- p2 text
FORM upload_file.
DATA : frow VALUE 2 TYPE i,
fcol VALUE 1 TYPE i,
erow VALUE 10000 TYPE i,
ecol VALUE 7 TYPE i,
ecol1 VALUE 1 TYPE i,
c_col1 TYPE i VALUE '0001',
c_col2 TYPE i VALUE '0002',
c_col3 TYPE i VALUE '0003',
&nb! sp; c_col4 TYPE i VALUE '0004',
c_col5 TYPE i VALUE '0005',
c_col6 TYPE i VALUE '0006',
c_col7 TYPE i VALUE '0007'.
***FM used to UPLOAD data from Flat file
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_fname
i_begin_col = fcol
i_begin_row = frow
i_end_col = ecol
i_end_row = erow
TABLES
intern = t_xls_file
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e000.
ENDIF.
****T_XLS_FILE is initial, stop the process & throw message
IF t_xls_file[] IS INITIAL.
FORMAT COLOR 6 ON INTENSIFIED ON.
WRITE:/ 'No Data Exists '.
FORMAT COLOR OFF INTENSIFIED OFF.
STOP.
ELSE.
* Sort table by rows and colums
SORT t_xls_file BY row col.
* Get first row retrieved
READ TABLE t_xls_file INDEX 1.
* Set first row retrieved to current row
v_currentrow = t_xls_file-row.
**Loop to move data in internal Table
LOOP AT t_xls_file .
* Reset values for next row
IF t_xls_file-row NE v_currentrow.
APPEND wa_header TO t_header.
CLEAR wa_header.
v_currentrow = t_xls_file-row.
ENDIF.
CASE t_xls_file-col.
WHEN c_col1. "Kschl
wa_header-kschl = t_xls_file-value.
WHEN c_col2. "Vkorg
wa_header-vkorg = t_xls_file-value.
WHEN c_col3. "vtweg
wa_header-vtweg = t_xls_file-value.
WHEN c_col4. "Matnr
wa_header-matnr = t_xls_file-value.
WHEN c_col5. "Kbetr
wa_header-kbetr = t_xls_file-value.
WHEN c_col6. "FROm
wa_header-datab = t_xls_file-value.
WHEN c_col7. "TO
wa_header-datbi = t_xls_file-value.
ENDCASE.
ENDLOOP.
APPEND wa_header TO t_header.
CLEAR wa_header.
ENDIF.
****To process the data
PERFORM f_process.
ENDFORM. " upload_file
*& Form READ_DATA
* text
* --> p1 text
* <-- p2 text
FORM read_data.
****To make Uniq Records in Header Level
SORT t_header BY kschl vkorg vtweg.
DELETE ADJACENT DUPLICATES FROM t_header COMPARING
kschl vkorg vtweg .
SORT t_item BY vkorg vtweg matnr.
DATA : wa1_item TYPE type_item.
DATA : l_cnt TYPE i.
DATA : flag(1) TYPE c. "to process the Line item.
***Looping Header Table.
LOOP AT t_header INTO wa_header.
PERFORM bdc_dynpro US! ING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ANTA'.
PERFORM bdc_field USING 'RV13A-KSCHL'
wa_header-kschl.
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV130-SELKZ(03)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_field USING 'RV130-SELKZ(03)'
'X'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KOMG-VKORG'.
PERFORM bdc_field USING 'KOMG-VKORG'
wa_header-vkorg.
PERFORM bdc_field USING 'KOMG-VTWEG'
wa_header-vtweg.
****To handle Line Items.
LOOP AT t_item INTO wa1_item WHERE vkorg = wa_header-vkorg AND
vtweg = wa_header-vtweg.
wa_item = wa1_item.
******Flag Set only After processing first 14 records .
IF flag = ' '.
v_lindx = v_lindx + 01.
SHIFT v_lindx LEFT DELETING LEADING '0'.
v_item = v_lindx .
CONCATENATE 'KOMG-MATNR(' v_item ')' INTO v_matnr.
PERFORM bdc_field USING v_matnr
wa_item-matnr.
CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
PERFORM bdc_field USING v_kbetr
wa_item-kbetr.
CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
PERFORM bdc_field USING v_dat
wa_item-datab.
CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
PERFORM bdc_field USING v_dat1
wa_item-datbi.
IF v_item = 14.
flag = 'X'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
CLEAR v_lindx.
CLEAR v_item.
CONTINUE.
ENDIF.
ENDIF.
***Flag is Set after Processing of 14 records.
****** TO process rest of Records
IF flag = 'X'.
v_pgedwn2 = v_pgedwn2 + 1.
v_lindx1 = v_lindx1 + 01.
SHIFT v_lindx1 LEFT DE! LETING LEADING '0'.
v_item = v_lindx1 .
CONCATENATE 'KOMG-MATNR(' v_it! em ')' INTO v_matnr.
PERFORM bdc_field USING v_matnr
wa_item-matnr.
CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
PERFORM bdc_field USING v_kbetr
wa_item-kbetr.
CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
PERFORM bdc_field USING v_dat
wa_item-datab.
CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
PERFORM bdc_field USING v_dat1
wa_item-datbi.
IF v_pgedwn2 = 13.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
v_pgedwn2 = 0.
v_lindx1 = 1.
CLEAR v_item.
CONTINUE.
ENDIF.
ENDIF.
ENDLOOP.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
****** Calling Transaction after Processing All items.
CALL TRANSACTION 'VK11' USING bdctab
OPTIONS FROM c_params MESSAGES INTO tmess_mtab.
REFRESH bdctab.
CLEAR : bdctab.
CLEAR : wa_item.
CLEAR : wa1_item.
CLEAR : wa_header.
CLEAR : l_cnt.
CLEAR : v_lindx1.
CLEAR: v_pgedwn2,v_lindx.
LOOP AT tmess_mtab .
l_cnt = l_cnt + 1.
READ TABLE t_item INTO wa_item INDEX l_cnt .
CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text
EXPORTING
arbgb = tmess_mtab-msgid
msgnr = tmess_mtab-msgnr
msgv1 = tmess_mtab-msgv1
msgv2 = tmess_mtab-msgv2
msgv3 = tmess_mtab-msgv3
msgv4 ! = tmess_mtab-msgv4
IMPORTING
msgtext = wa_mtab-text
EXCEPTIONS
message_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
wa_mtab-matnr = wa_item-matnr.
wa_mtab-msgtyp = tmess_mtab-msgtyp.
wa_mtab-msgid = tmess_mtab-msgid.
wa_mtab-msgn! r = tmess_mtab-msgnr.
APPEND wa_mtab TO t_mtab.
CLEAR wa_mtab-text.
CLEAR wa_item.
ENDLOOP.
ENDLOOP.
ENDFORM. " READ_DATA
*& Form BDC_DYNPRO
* text
* -->P_0300 text
* -->P_0301 text
* Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdctab.
bdctab-program = program.
bdctab-dynpro = dynpro.
bdctab-dynbegin = 'X'.
APPEND bdctab.
ENDFORM. " BDC_DYNPRO
*& Form BDC_FIELD
* text
* -->P_0305 text
* -->P_WA_HEADER_KSCHL text
* Insert field *
FORM bdc_field USING fnam fval.
CLEAR bdctab.
bdctab-fnam = fnam.
bdctab-fval = fval.
APPEND bdctab.
ENDFORM. " BDC_FIELD
*& Form bdc_trc_ansaction
* text
* -->P_0527 text
*& Form f_Process
* text
* --> p1 text
* <-- p2 text
FORM f_process.
DATA : l_todate(12) TYPE c,
l_frdate(12) TYPE c.
***Select for all entries of material in Header "Flat File Materials".
IF NOT t_header[] IS INITIAL.
SELECT matnr vkorg vtweg FROM mvke INTO TABLE t_mvke FOR ALL ENTRIES
IN t_header WHERE matnr = t_header-matnr AND
vkorg = t_header-vkorg AND
vtweg = t_header-vtweg.
ENDIF.
*********select Sales.org & Dist.channel.
IF NOT t_header[] IS INITIAL.
SELECT vkorg vtweg FROM tvkov INTO TABLE t_tvkov FOR ALL ENTRIES IN
t_header WHERE vkorg = t_header-vkorg
AND vtweg = t_header-vtweg.
ENDIF.
***Checking for material in Sales Master Table
SORT t_mvke BY matnr vkorg vtweg.
SORT t_tvkov BY vkorg vtweg.
LOOP AT t_header INTO wa_header.
READ TABLE t_mvke INTO wa_mvke WITH KEY matnr = wa_header-matnr
vkorg = wa_header-vkorg
! ; vtweg = wa_header-vtweg BINARY SEARCH.
IF sy-subrc <> 0.
wa_error = wa_header.
&nb! sp; MOVE text-011 TO wa_error-text.
APPEND wa_error TO t_error.
DELETE TABLE t_header FROM wa_header.
ELSE.
********Date Validations
IF ( wa_header-datab NE ' ! ; ' AND wa_header-datbi NE ' ' ) .
l_todate = wa_header-datab.
l_frdate = wa_header-datbi.
REPLACE '.' INTO l_toda! te WITH ''.
REPLACE '.' INTO l_todate WITH ''.
CONDENSE l_todate NO-GAPS.
REPLACE '.' INTO l_frdate WITH ''.
REPLACE '.' INTO l_frdate WITH ''.
CONDENSE l_frdate NO-GAPS.
IF l_frdate < l_todate.
wa_error = wa_header .
MOVE text-012 TO wa_error-text.
APPEND wa_error TO t_error.
DELETE TABLE t_header FROM wa_header.
ENDIF.
ELSE.
wa_error = wa_header .
MOVE text-016 TO wa_error-text.
APPEND wa_error TO t_error.
DELETE TABLE t_header FROM wa_header.
ENDIF.
ENDIF.
********Rate Validation.
IF wa_header-kbetr = ' '.
wa_error = wa_header .
MOVE text-017 TO wa_error-text.
APPEND wa_error TO t_error.
DELETE TABLE t_header FROM wa_header.
ENDIF.
READ TABLE t_tvkov INTO wa_tvkov WITH KEY vkorg = wa_header-vkorg
BINARY SEARCH.
IF sy-subrc = 0.
READ TABLE t_tvkov INTO wa_tvkov WITH KEY vtweg = wa_header-vtweg
BINARY SEARCH.
IF sy-subrc <> 0.
wa_error = wa_header.
MOVE text-015 TO wa_error-text.
WRITE wa_header-vtweg TO wa_error-text+13(4).
APPEND wa_error TO t_error.
ENDIF.
ELSE.
wa_error = wa_header.
MOVE text-013 TO wa_error-text.
WRITE wa_header-vkorg TO wa_error-text+9(4).
APPEND wa_error TO t_error.
ENDIF.
CLEAR wa_header.
ENDLOOP.
*****Deleting Duplicate Material Form Header "Flat File Data".
SORT t_header BY kschl vkorg vtweg matnr.
DELETE ADJACENT DUPLICATES FROM t_header COMPARING
kschl! vkorg vtweg matnr .
* ****Data Moving from Header to Item Level.
t_item[] = t_header[].
*To count No.of records in Item Table.
DESCRIBE TABLE t_item LINES v_count.
CONCATENATE text-014 ' ' v_count INTO v_bdc.
****Popup to get Confirmation from user to process BDC
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Confirmation of File Data'
text_question = v_bdc
text_button_1 = 'Confirm'
text_button_2 = 'Cancel Run'
default_button = '1'
IMPORTING
answer = c_ans.
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. " f_Process
*& Form f_Refresh
* text
* --> p1 text
* <-- p2 text
FORM f_refresh.
REFRESH : t_xls_file,
t_header,
t_item,
t_mvke,
t_tvkov,
t_error,
t_mtab.
CLEAR : t_xls_file,
wa_header,
wa_item,
wa_mvke,
wa_tvkov,
wa_error,
wa_mtab.
ENDFORM. " f_Refresh
reward point s if it is usefull ....
girish -
Hi all,
I've created a BDC for transaction KO02 that will add settlement rules to an existing order. Then I'm using the generated code to create a new program. I have two questions.
1. I need to validate against existing settlement rules. Is there a way to get this information, i.e. can I read the existing table somehow?
2. When I enter multiple entries, I noticed the following calls:
perform bdc_dynpro using 'SAPLKOBS' '0130'.
perform bdc_field using 'BDC_CURSOR' 'COBRB-BETRR(01)'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'COBRB-KONTY(01)' XXX'.
perform bdc_field using 'DKOBR-EMPGE(01)' 'XXX'.
perform bdc_field using 'COBRB-BETRR(01)' 'XXX'.
perform bdc_dynpro using 'SAPLKOBS' '0130'.
perform bdc_field using 'BDC_CURSOR' 'COBRB-BETRR(02)'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'COBRB-KONTY(02)' 'XXX'.
perform bdc_field using 'DKOBR-EMPGE(02)' 'XXX'.
perform bdc_field using 'COBRB-BETRR(02)' 'XXX'.
perform bdc_dynpro using 'SAPLKOBS' '0130'.
Do I need to increment those numbers myself? For example, COBRB-KONTY(01) -> COBRB-KONTY(02)?
Thanks!1) COAS - AUFNR
OBJNR -> COBRA-OBJNR, COBRB-OBJNR
as for your 1st question check for the COBRA to see if you can get the existing settlement rules for the order . You have to add more logic to the program for the check.
2) When you go to the Settlement screen on the top on status bar you see a icon for CREATE. Record that in SHDB - Click on it while recording and you can change your program to the program.
Do check BAPI_INTERNALORDER_CREATE
BAPI_INTERNALORDER_SAVEREPLICA helps your requirement. -
Salary Increments/Salary Adjusments/ Promotions
Hi
I am looking for information on what APIs are available to perform the following:
1. Salary increments
2. Salary adjustments
3. Promotions (change in grade n designation)
Regards
- SairaIf you just wanted to modify or update the salary information yearly or periodically after appraisal i would use WebADI, where there is a seeded integretor available with the product
Regards
Ramesh S -
BDC For VA01(For MULTIPLE Material ie Multiple Line Items)
i have to do A BDC using call trasncation which has Multiple material in line items,so please could you send me some sample code
Hii pls refer the following code.. it is BDC for me31k.. hop this will help....
*& Report name : ZOA_P1 *&
*& Program title : Outline agreement Creation program *&
*& Description : BDC program which creates outline *&
*& agreement *&
*& Author : Sheeba B *&
*& Author ID : 5855 *&
REPORT zoa_p1
NO STANDARD PAGE HEADING LINE-SIZE 100.
include program***************************
INCLUDE zbdcrecx4.
*C-structure for table ekko fields
TYPES:BEGIN OF tp_temp,
lifnr TYPE lifnr,
ekorg TYPE ekorg,
ekgrp TYPE ekgrp,
bukrs TYPE bukrs,
END OF tp_temp.
****************Declarations********************
*C-variables for table ekko field
DATA: BEGIN OF tp_final OCCURS 0,
lifnr TYPE lifnr,
ekorg TYPE ekorg,
ekgrp TYPE ekgrp,
bukrs TYPE bukrs,
ematn TYPE ematn,
ktmng TYPE ktmng,
netpr TYPE netpr,
werks TYPE werks,
END OF tp_final,
*C-variables used in the program
wa_temp TYPE tp_temp,
*C-variable for entering multiple item level details
*C-for same vendor
w_count(2) TYPE c VALUE '01',
w_count(2) type N value 01,
w_str(40) TYPE c,
w_str1 TYPE string.
*C-selection screen parameter for file name
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(20) text-000 FOR FIELD f_name.
SELECTION-SCREEN POSITION 25.
PARAMETERS: f_name LIKE rlgrap-filename.
SELECTION-SCREEN END OF LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_name.
CALL FUNCTION 'DSVAS_DOC_WS_FILENAME_GET_50'
EXPORTING
def_filename = 'F_NAME'
def_path = 'C:\'
mask = '.TXT'
MODE = ' '
TITLE = ' '
IMPORTING
filename = f_name
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
*IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
***Start of selection*********
START-OF-SELECTION.
*C-function for uploading file from workstation
w_str1 = f_name.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = w_str1
FILETYPE = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = tp_final
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.
*C-looping at internal table for passing
*C-field values to transaction
LOOP AT tp_final.
MOVE :tp_final-lifnr TO wa_temp-lifnr,
tp_final-ekorg TO wa_temp-ekorg,
tp_final-ekgrp TO wa_temp-ekgrp,
tp_final-bukrs TO wa_temp-bukrs.
*C-for each new vendor
*C-pass header details to transaction
AT NEW lifnr.
REFRESH bdcdata.
PERFORM :bdc_dynpro USING 'SAPMM06E' '0200',
bdc_field USING 'BDC_OKCODE'
'/00',
bdc_field USING 'EKKO-LIFNR'
wa_temp-lifnr,
bdc_field USING 'EKKO-EKORG'
wa_temp-ekorg,
bdc_field USING 'EKKO-EKGRP'
wa_temp-ekgrp,
bdc_dynpro USING 'SAPMM06E' '0514',
bdc_field USING 'BDC_OKCODE'
'=ENTE',
bdc_field USING 'EKKO-BUKRS'
wa_temp-bukrs,
bdc_dynpro USING 'SAPMM06E' '0201',
bdc_field USING 'BDC_OKCODE'
'/00',
bdc_field USING 'EKKO-KDATE'
'12/31/9999'.
ENDAT.
*C-passing item level details to transaction
PERFORM :bdc_dynpro USING 'SAPMM06E' '0220',
bdc_field USING 'BDC_OKCODE'
'/00'.
CONCATENATE 'EKPO-EMATN(' w_count')' INTO w_str.
PERFORM bdc_field USING w_str tp_final-ematn.
CONCATENATE 'EKPO-KTMNG(' w_count')' INTO w_str.
PERFORM bdc_field USING w_str tp_final-ktmng.
CONCATENATE 'EKPO-NETPR(' w_count')' INTO w_str.
PERFORM bdc_field USING w_str tp_final-netpr.
CONCATENATE 'EKPO-WERKS(' w_count')' INTO w_str.
PERFORM bdc_field USING w_str tp_final-werks.
PERFORM:bdc_dynpro USING 'SAPMM06E' '0211',
bdc_dynpro USING 'SAPMM06E' '0220',
bdc_field USING 'BDC_OKCODE'
'/00'.
*C-Incrementing count for insertin next
*C-line item for the same vendor
w_count = w_count + '01'.
CONCATENATE '0' w_count INTO w_count.
*C-For different vendors save details and create contract.
AT END OF lifnr.
PERFORM : bdc_dynpro USING 'SAPMM06E' '0211',
bdc_dynpro USING 'SAPMM06E' '0220',
bdc_field USING 'BDC_CURSOR'
'RM06E-EBELP',
bdc_field USING 'BDC_OKCODE'
'=BU',
bdc_transaction USING 'ME31K'.
*C-resetting w_count for new vendor
w_count = '01'.
ENDAT.
ENDLOOP. -
Error while running a BDC for the Transaction F-02
Hi,
I'm getting an error <b><i>"Parking not possible during Batch Input"</i></b> while running a BDC for the transaction F-02.
When i click on the error message it displays the message [b<i>]"In Customizing, you can control whether an error message is issued."</b></i>
How to solve this issue?.
Waiting for ur replies.........
Regards
N.SenthilHi,
When you are doing the recording in SHDB, and in the same screen where the TCODE to be recorded is given, there are options that you can choose called "Recording Parameters"...Select the checkbox which says "Not a Batch Input Session", this will set the sy-binpt variable to " "(in a recording by default it is "X")...and you will not get this error...
Also make sure while writing the BDC program to make use of the "bdc options" parameter which has this property to switch of sy-binpt...
Refer below theard for sample bdc code for f-02.
https://forums.sdn.sap.com/click.jspa?searchID=5126766&messageID=1538409
Regards -
Problem in creation of BDC for transaction phap_create
Hello Friends,
I am trying to create BDC for PHAP_CREATE.
When you run a transaction a pop up window appears to select the template id.
And in BDC it is selected by cursor position. So once selected, the value of template id cannot be changed.
I want this as a parameter.So that each time I run a BDC I will be able to create different types of Appraisal documents i.e with different template ids.
How to go about it???
Regards,
BhushanHi,
For selecting the id, while doing recording,
record with
CTRL + F ( Where u can give ur id) and proceed further. -
How to give line items in flatfile while doing BDC for Table control
Hi all,
I am writing BDC for Multiple line items and Transaction is : FSE5N.
How do i give the data in the flat file. I mean how do we give the multiple line items in flat file , i.e for second line item again we have to header data or not ?
ex:
1015;ALL;demo;kr;INR;01;0001;3000172;100
1015;ALL;demo;kr;INR;01;0001;3000172;200
for first lineitem : 3000172;100
for 2nd line item : 3000172; 200.
header data : 1015;ALL;demo;kr;INR;01;0001.
Thanks in advance
krupaliHii ,
u can give in the same format as u have done in the example.
A B C D E F G H I
1015;ALL;demo;kr;INR;01;0001;3000172;100
1015;ALL;demo;kr;INR;01;0001;3000172;200
and while writing the loop u can give
loop at it_head.
loop at it_head where a = it_head-A and b = it_head-B ..........upto G = it_head-G.
endloop.
endloop.
check this
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Neeraj
Maybe you are looking for
-
When I try to start the windows tech. prev. installation on a virtual machine (running dynamically expanding hard disk and using 1500MB ram) the windows logo appears, but shortly after says the following message: Your PC needs to restart Please hold
-
Help! Please, help! Can't access iTunes 7 library!
I loaded my iTunes this morning, and it was comletely blank. Not the iPod, but the iTunes. I had over 600 songs, all from CDs on there, and they're all gone. iTunes says that all my songs are in a different library, but when I do the shift-double cli
-
My iphone 4 lost ALL of the ios apps
I've lost all of the ios 5 apps -- settings, weather, contacts, phone, messaging, safari, etc -- on my phone. I tried the "search iphone" to the left, but found nothing. I can receive texts, but when I swipe the screen to read it I get this respons
-
Problem in shuffling the button and puting image on button in the same code
I'm trying to make 16 block puzzel game. The following code is showing desired output when I'm running it in textpad but it's showing the output in eclipse. Please tell me the reason behind it. import java.awt.*; import javax.swing.*; import java.awt
-
After going through tons of support discussions and trying all that i could i would like to ask your help guys. As header suggests im having problems with incoming emails on mac mail (4.6) (outgoing mails are working perfectly) Yesterday evening i n