Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Applicant Create (BAPI_APPLICANT_CREATE)

Former Member
0 Likes
1,790

Hi ,

I know its lenghty but am sure an ABAP programmer can understand my problem.

My requirement is to create an applicant in SAP system by reading the file from the applicantion server .I have written an interface program to create the Applicants in SAP recruitment model. Basically the data comes from the external system( website) is a CSV format.

WELL!!! I cannot use BDC to create applicants because they could be created in different countries (7) . As I say the screen would be different for each country . I dont know anything about dynamic recording of screens so this is out of the way.

I have tried the bapi function module BAPI_APPLICANT CREATE but this is giving an error " No batch input data for screen SAPLRHP6 6000 " (Qualifications)

When I tried to debug the FM in all screen mode org assignment , education, actions and personnel data infotypes are created correctly. But even thought have passed the qualifications import paranmeter nothing is being passed into it. QUalifications is the mandatory screen for the applicant master data .

Below the data I am passing into the qualifications table in BAPI.Okay I will be creating the proficiencies only in languages.

QUALIF P PROF

50000000 1 0001

Please can you help me the best way forward . IThis is vey urgent , I have tried all m y ways and hands up now

Thanks and Regards,

Aarti

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,352

Hi Aarthi,

Good question give me some time let me go through and let me see if i can help you.

Lakshmikanth.T.V

9 REPLIES 9
Read only

Former Member
0 Likes
1,353

Hi Aarthi,

Good question give me some time let me go through and let me see if i can help you.

Lakshmikanth.T.V

Read only

Former Member
0 Likes
1,352

Hi Aarati Ramaraju ,

I think you are not passing some important input parameter to the BAPI call.

Check the Business object APPLICANT for method "Create" There is a sample code inside this method:

BEGIN_METHOD CREATEFROMDATA CHANGING CONTAINER.

DATA:

APPLICANTGROUP LIKE BAPIAPLORG-AP_GROUP,

APPLICANTSUBGROUP LIKE BAPIAPLORG-AP_SUBGRP,

PERSONELAREA LIKE BAPIAPLORG-PERS_AREA,

PERSONALSUBAREA LIKE BAPIAPLORG-P_SUBAREA,

PERSONNEL LIKE BAPIAPLORG-PERSONNEL,

FIRSTOFADRESSKEY LIKE BAPIAPLPER-FOA_KEY,

FIRSTNAME LIKE BAPIAPLPER-F_NAME,

LASTNAME LIKE BAPIAPLPER-L_NAME,

MAIDENNAME LIKE BAPIAPLPER-BIRTHNAME,

SECONDLASTNAME LIKE BAPIAPLPER-LAST_NAME2,

KNOWNAS LIKE BAPIAPLPER-KNOWN_AS,

SSN LIKE BAPIAPLPER-SSN,

DATEOFBIRTH LIKE BAPIAPLPER-B_DATE,

TITLE LIKE BAPIAPLPER-TITLE,

TITLE2 LIKE BAPIAPLPER-2ND_TITLE,

ARISTOCRATICTITLE LIKE BAPIAPLPER-ARI_TITLE,

AFFIX LIKE BAPIAPLPER-AFFIX,

PREFIX2 LIKE BAPIAPLPER-PREFIX_2,

GENDER LIKE BAPIAPLPER-GENDER,

PLACEOFBIRTH LIKE BAPIAPLPER-BIRTHPLACE,

MARITALSTATUS LIKE BAPIAPLPER-MAR_STAT,

INITIALS LIKE BAPIAPLPER-INITIALS,

NATION LIKE BAPIAPLPER-NATION,

LETTERLANGUAGE LIKE BAPIAPLPER-LANGU,

CO LIKE BAPIAPLADR-C_O,

STREET LIKE BAPIAPLADR-STREET,

ADDRESS2NDLINE LIKE BAPIAPLADR-2ND_ADD_LN,

CITY LIKE BAPIAPLADR-CITY,

REGION LIKE BAPIAPLADR-REGION,

DISTRICT LIKE BAPIAPLADR-DISTRICT,

ZIPCODE LIKE BAPIAPLADR-PCD_CITY,

COUNTRY LIKE BAPIAPLADR-CNTRY,

TELEPHONNO LIKE BAPIAPLADR-TEL_NO,

ADVERTISEMENT LIKE BAPIAPPLIC-ADVERT,

UNSOLICITEDAPPLGROUP LIKE BAPIAPPLIC-UNSAPPGP,

MEDIUM LIKE BAPIAPPLIC-MEDIUM,

RETURN LIKE BAPIRETURN,

EDUCATION LIKE BAPIEDUC OCCURS 0,

PREVIOUSEMPLOYMENT LIKE BAPIEMPLOY OCCURS 0,

QUALIFICATION LIKE BAPIQUALI OCCURS 0,

VACANCYASSIGNMENT LIKE BAPIVACASS OCCURS 0,

EMPLOYEENUMBER LIKE BAPIP0001-PERNR, "WBIK005689

COMMUNICATIONTYPE LIKE BAPIP0105B-USERTYPE, "WBIK005689

EMAIL LIKE BAPIHR0105-E_MAIL. "WBIK005689

SWC_GET_ELEMENT CONTAINER 'ApplicantGroup' APPLICANTGROUP.

SWC_GET_ELEMENT CONTAINER 'ApplicantSubGroup' APPLICANTSUBGROUP.

SWC_GET_ELEMENT CONTAINER 'PersonelArea' PERSONELAREA.

SWC_GET_ELEMENT CONTAINER 'PersonalSubArea' PERSONALSUBAREA.

SWC_GET_ELEMENT CONTAINER 'Personnel' PERSONNEL.

SWC_GET_ELEMENT CONTAINER 'FirstOfAdressKey' FIRSTOFADRESSKEY.

SWC_GET_ELEMENT CONTAINER 'FirstName' FIRSTNAME.

SWC_GET_ELEMENT CONTAINER 'LastName' LASTNAME.

SWC_GET_ELEMENT CONTAINER 'MaidenName' MAIDENNAME.

SWC_GET_ELEMENT CONTAINER 'SecondLastName' SECONDLASTNAME.

SWC_GET_ELEMENT CONTAINER 'KnownAs' KNOWNAS.

SWC_GET_ELEMENT CONTAINER 'SSN' SSN.

SWC_GET_ELEMENT CONTAINER 'DateOfBirth' DATEOFBIRTH.

SWC_GET_ELEMENT CONTAINER 'Title' TITLE.

SWC_GET_ELEMENT CONTAINER 'Title2' TITLE2.

SWC_GET_ELEMENT CONTAINER 'AristocraticTitle' ARISTOCRATICTITLE.

SWC_GET_ELEMENT CONTAINER 'Affix' AFFIX.

SWC_GET_ELEMENT CONTAINER 'Prefix2' PREFIX2.

SWC_GET_ELEMENT CONTAINER 'Gender' GENDER.

SWC_GET_ELEMENT CONTAINER 'PlaceOfBirth' PLACEOFBIRTH.

SWC_GET_ELEMENT CONTAINER 'MaritalStatus' MARITALSTATUS.

SWC_GET_ELEMENT CONTAINER 'Initials' INITIALS.

SWC_GET_ELEMENT CONTAINER 'Nation' NATION.

SWC_GET_ELEMENT CONTAINER 'LetterLanguage' LETTERLANGUAGE.

SWC_GET_ELEMENT CONTAINER 'CO' CO.

SWC_GET_ELEMENT CONTAINER 'Street' STREET.

SWC_GET_ELEMENT CONTAINER 'Address2ndLine' ADDRESS2NDLINE.

SWC_GET_ELEMENT CONTAINER 'City' CITY.

SWC_GET_ELEMENT CONTAINER 'Region' REGION.

SWC_GET_ELEMENT CONTAINER 'District' DISTRICT.

SWC_GET_ELEMENT CONTAINER 'ZipCode' ZIPCODE.

SWC_GET_ELEMENT CONTAINER 'Country' COUNTRY.

SWC_GET_ELEMENT CONTAINER 'TelephonNo' TELEPHONNO.

SWC_GET_ELEMENT CONTAINER 'Advertisement' ADVERTISEMENT.

SWC_GET_ELEMENT CONTAINER 'UnsolicitedApplGroup' UNSOLICITEDAPPLGROUP.

SWC_GET_ELEMENT CONTAINER 'Medium' MEDIUM.

SWC_GET_ELEMENT CONTAINER 'EmployeeNumber' EMPLOYEENUMBER. "WBIK005689

SWC_GET_ELEMENT CONTAINER 'CommunicationType' COMMUNICATIONTYPE. "WBIK

SWC_GET_ELEMENT CONTAINER 'EMail' EMAIL. "WBIK005689

SWC_GET_TABLE CONTAINER 'Education' EDUCATION.

SWC_GET_TABLE CONTAINER 'PreviousEmployment' PREVIOUSEMPLOYMENT.

SWC_GET_TABLE CONTAINER 'Qualification' QUALIFICATION.

SWC_GET_TABLE CONTAINER 'VacancyAssignment' VACANCYASSIGNMENT.

CALL FUNCTION 'BAPI_APPLICANT_CREATE'

EXPORTING

2ND_ADD_LN = ADDRESS2NDLINE

STREET = STREET

C_O = CO

LANGU = LETTERLANGUAGE

NATION = NATION

INITIALS = INITIALS

MAR_STAT = MARITALSTATUS

BIRTHPLACE = PLACEOFBIRTH

CITY = CITY

MEDIUM = MEDIUM

UNSAPPGP = UNSOLICITEDAPPLGROUP

ADVERT = ADVERTISEMENT

TEL_NO = TELEPHONNO

CNTRY = COUNTRY

PCD_CITY = ZIPCODE

DISTRICT = DISTRICT

REGION = REGION

GENDER = GENDER

L_NAME = LASTNAME

F_NAME = FIRSTNAME

FOA_KEY = FIRSTOFADRESSKEY

PERSONNEL = PERSONNEL

P_SUBAREA = PERSONALSUBAREA

PERS_AREA = PERSONELAREA

AP_SUBGRP = APPLICANTSUBGROUP

AP_GROUP = APPLICANTGROUP

BIRTHNAME = MAIDENNAME

SECONDNAME = SECONDLASTNAME

PREFIX_2 = PREFIX2

AFFIX = AFFIX

ARI_TITLE = ARISTOCRATICTITLE

2ND_TITLE = TITLE2

KNOWN_AS = KNOWNAS

SSN = SSN

B_DATE = DATEOFBIRTH

TITLE = TITLE

EMPLOYEENUMBER = EMPLOYEENUMBER "WBIK005689

COMMUNICATION_TYPE = COMMUNICATIONTYPE "WBIK005689

E_MAIL = EMAIL "WBIK005689

IMPORTING

RETURN = RETURN

APPLICANTNUMBER = OBJECT-KEY-APPLICANTNUMBER

TABLES

VACANCY_ASSIGNMENT = VACANCYASSIGNMENT

QUALIFICATION = QUALIFICATION

PREVIOUS_EMPLOYMENT = PREVIOUSEMPLOYMENT

EDUCATION = EDUCATION

EXCEPTIONS

OTHERS = 01.

CASE SY-SUBRC.

WHEN 0. " OK

WHEN OTHERS. " to be implemented

ENDCASE.

SWC_SET_ELEMENT CONTAINER 'Return' RETURN.

SWC_SET_TABLE CONTAINER 'Education' EDUCATION.

SWC_SET_TABLE CONTAINER 'PreviousEmployment' PREVIOUSEMPLOYMENT.

SWC_SET_TABLE CONTAINER 'Qualification' QUALIFICATION.

SWC_SET_TABLE CONTAINER 'VacancyAssignment' VACANCYASSIGNMENT.

END_METHOD.

Also check the include "MPW12F01" for another sample code that SAP uses to create the applicant:

*&----


*

*& Form UPDATE_APPLICANT

*&----


*

FORM update_applicant.

DATA: initdate LIKE p0022-begda.

DATA: initquali LIKE p0024-quali.

DATA: additional_suppress TYPE c VALUE 'X'. "XDVN618851

DATA: BEGIN OF tab OCCURS 5,

subty LIKE t591a-subty,

END OF tab.

DATA: ind LIKE syst-index.

DATA: BEGIN OF infty_0001 OCCURS 1.

INCLUDE STRUCTURE p0001.

DATA: END OF infty_0001.

DATA: BEGIN OF infty_4001 OCCURS 1.

INCLUDE STRUCTURE p4001.

DATA: END OF infty_4001.

DATA: BEGIN OF old_adr,

stras LIKE bapiapladr-street,

name2 LIKE bapiapladr-c_o,

locat LIKE bapiapladr-2nd_add_ln,

ort01 LIKE bapiapladr-city,

ort02 LIKE bapiapladr-district,

END OF old_adr.

DATA: BEGIN OF old_per,

nachn LIKE bapiaplper-l_name,

vorna LIKE bapiaplper-f_name,

name2 LIKE bapiaplper-birthname,

rufnm LIKE bapiaplper-known_as,

gbort LIKE bapiaplper-birthplace,

END OF old_per.

REFRESH education. "LCP46C Note 204481

LOOP AT tab0022.

CHECK tab0022-begda NE initdate.

CLEAR education.

MOVE tab0022-begda TO education-from_date.

MOVE tab0022-endda TO education-to_date.

MOVE tab0022-insti TO education-institute.

MOVE tab0022-slabs TO education-certific.

MOVE tab0022-slart TO education-educ_est.

MOVE tab0022-sland TO education-cntry.

MOVE tab0022-sltp1 TO education-br_study_1.

MOVE tab0022-sltp2 TO education-br_study_2.

MOVE tab0022-emark TO education-mark. "4.6C

APPEND education.

ENDLOOP.

IF sy-subrc NE 0. "4.6C

REFRESH education. CLEAR education. "4.6C

ENDIF. "4.6C

REFRESH employer. "LCP46C Note 204481

LOOP AT tab0023.

CHECK tab0023-begda NE initdate.

CLEAR employer.

MOVE tab0023-begda TO employer-from_date.

MOVE tab0023-endda TO employer-to_date.

MOVE tab0023-arbgb TO employer-employer.

MOVE tab0023-land1 TO employer-cntry.

MOVE tab0023-ort01 TO employer-city.

MOVE tab0023-taete TO employer-job.

MOVE tab0023-ansvx TO employer-employment_contract. "4.6C

APPEND employer.

ENDLOOP.

IF sy-subrc NE 0. "4.6C

REFRESH employer. CLEAR employer. "4.6C

ENDIF. "4.6C

REFRESH qualification. "LCP46C Note 204481

LOOP AT tab0024.

CHECK tab0024-quali NE initquali.

CLEAR qualification.

MOVE tab0024-quali TO qualification-qualif.

  • MOVE TAB0024-AUSPR TO QUALIFICATION-PROFIC. "XCZK034654

MOVE tab0024-auspr TO qualification-profic_4. "XCZK034654

APPEND qualification.

ENDLOOP.

IF sy-subrc NE 0. "4.6C

REFRESH qualification. CLEAR qualification. "4.6C

ENDIF. "4.6C

REFRESH tab.

CLEAR tab.

  • Lesen der Infosubtypeigenschaften für den IT4002.

SELECT * FROM t591a WHERE infty EQ '4002'.

tab-subty = t591a-subty.

APPEND tab.

CLEAR tab.

ENDSELECT.

ind = 0.

REFRESH vacancy_assignment. "WBIK

CLEAR vacancy_assignment. "WBIK

  • LOOP AT S_VACANCIES. "WBIK059034

LOOP AT s_vacancies WHERE indic = 'X'. "WBIK059034

ADD 1 TO ind.

READ TABLE tab INDEX ind.

IF sy-subrc NE 0.

EXIT.

ENDIF.

CLEAR vacancy_assignment.

vacancy_assignment-priority = tab-subty.

vacancy_assignment-va_status = '1'.

vacancy_assignment-vacancy = s_vacancies-objid.

APPEND vacancy_assignment.

ENDLOOP.

  • Default-Werte aus den Merkmalen INTDF und INTDY.

infty_0001-werks = int_defaults-werks.

infty_0001-btrtl = int_defaults-btrtl.

infty_0001-persg = int_defaults-persg.

infty_0001-persk = int_defaults-persk.

infty_0001-sachp = int_defaults-sachp.

infty_4001-spapl = int_defaults-spapl.

infty_4001-media = int_defaults-media.

p0002-sprsl = sy-langu.

CLEAR: text_1000_2, text_1000_1.

MOVE-CORRESPONDING p0002 TO old_per.

MOVE-CORRESPONDING p0006 TO old_adr.

  • Flag additional_suppress is set in case of internet application;

  • for internet application an additional suppress dialog is necessary

  • when automatically generating an activity.

  • flag is imported in PBO-Module INIT_D1000 of program SAPMPAP3.

EXPORT additional_suppress TO MEMORY ID 'ADD_SUPP'. "XDVN618851

  • Mit dieser Methode kann ein Bewerber angelegt werden. Es finden alle

  • Konsistenzprüfungen statt, die auch bei einer Bewerberdatenerfassung

  • innerhalb der R/3-Transaktionen durchgeführt werden. Es wird nur dann

  • ein Bewerber angelegt, wenn alle Konsistenzprüfungen erfolgreich

  • abgeschlossen werden konnten. Die vom System vergebene Bewerbernummer

  • sowie ein Returncode werden zurückgegeben.

  • Technisch wird die Tabelle PROPOSED-VALUES gefüllt, wobei diese Daten

  • mit dem Dialogbaustein RP_TRANSFER_APPLICANT weggeschrieben werden.

  • Der BAPI-Returnparameter wird gesetzt und die Texte der System-

  • variablen werden im Nachrichtentext eingefügt.

CALL FUNCTION 'BAPI_APPLICANT_CREATE'

EXPORTING

ap_group = int_defaults-persg

ap_subgrp = int_defaults-persk

pers_area = int_defaults-werks

p_subarea = int_defaults-btrtl

personnel = int_defaults-sachp

foa_key = p0002-anred

f_name = old_per-vorna

l_name = old_per-nachn

birthname = old_per-name2

known_as = old_per-rufnm

ssn = p0002-perid

b_date = p0002-gbdat

title = p0002-titel

2nd_title = p0002-titl2

ari_title = p0002-namzu

affix = p0002-vorsw

prefix_2 = p0002-vors2

gender = p0002-gesch

birthplace = old_per-gbort

mar_stat = p0002-famst

initials = p0002-inits

nation = p0002-natio

langu = sy-langu

c_o = old_adr-name2

street = old_adr-stras

2nd_add_ln = old_adr-locat

city = old_adr-ort01

region = p0006-state

district = old_adr-ort02

pcd_city = p0006-pstlz

cntry = p0006-land1

tel_no = p0006-telnr

advert = advert "XCZ

unsappgp = int_defaults-spapl

medium = int_defaults-media

employeenumber = pernr "WBIK031606

communication_type = '0010' "WBIK031606

e_mail = p0105-usrid_long "WBIK031606

IMPORTING

applicantnumber = rpapp-aplno

return = bapi_rcode

TABLES

education = education

previous_employment = employer

qualification = qualification

vacancy_assignment = vacancy_assignment

EXCEPTIONS

OTHERS = 0.

IF bapi_rcode IS INITIAL. "WBIK059033

PERFORM save_orig_data USING rpapp-aplno. "WBIK059033

already_applicant = yes. "XDVN427098

  • new / J. Naeckel

Let me know if you have any questions.

Thanks,

Greetson

Read only

0 Likes
1,352

Thanks Greetson. Your reply is much appreciated.

I have tried to execute the method of the function module via SW01 by passing in the same parameters from F4 help.

Unfortunately even this gives the same error message " NO BATCH INPUT DATA" for the qualifications screen.

I am using the object ids for Languages obtained from the FM BAPI_PDOTYPE_Q_GETDETAIL

FOR OBJECT ID 50000013 ENGLISH language.

PS:I need to create only the languages proficiency in the qualifications record.

Secondly the include is being used to updating the existing applicant data so the qualifications data is being exported from the FM HR_GET_APPLICANT_DATA

Please can you try executing the busienss object at your end by passing in the qualifications data and see if this works out.

Apologies for that !!!!.

Edited by: Aarati Ramaraju on Mar 13, 2008 5:48 PM

Read only

0 Likes
1,352

I am getting a error " EPA001Assignment to advertisement or unsolicited applicant group only" I am not usre what I need to passto the import pagameter "ADVERTISEMENT" and "UNSOLICITEDAPPLGROUP" ???

thanks ,

Greetson

Read only

0 Likes
1,352

Thanks Greetson,

I normally pass ' 999 ' (Agency or other ) value for Unsolicited group.

But this could depend on customisation of the system , so I would say you can use SAP standatrd '002' or '003' . #

Otherwise you can use F4 help from the method parameter.

I will look forward for your reply please.

Edited by: Aarati Ramaraju on Mar 14, 2008 11:57 AM

Read only

0 Likes
1,352

Hi Sorry,

May I please again request for a sample code for BAPI_APPLICANT_CREATE function module wherein the qualifications data has been entered.

Even if not I just need an idea as to how an applicant data can be created in HR recruitment in background and this is required for 9 countries.

Earliest help will be appreciated please.

Thanks and Regards,

Aarthi

Read only

0 Likes
1,352

Hello everyone,

Can I expect some feedback for my query please ?

Aarthi

Read only

0 Likes
1,352

Hi ,

I have found a soution to this problem and thought to share it in case you might come accross similar issues .

Okay - Functional consultant has removed the qualification screen from the sequence while creating the applicant record. Actually we have setup a user group '99' only for the loading the e-recruitment applicant.

Even though we remove the qualifications screen BAPI itself will create a the record is data is passed to BAPI_QUALI

Read only

0 Likes
1,352

Hi ,

I have found a soution to this problem and thought to share it in case you might come accross similar issues .

Okay - Functional consultant has removed the qualification screen from the sequence while creating the applicant record. Actually we have setup a user group '99' only for the loading the e-recruitment applicant.

Even though we remove the qualifications screen BAPI itself will create a the record is data is passed to BAPI_QUALI