Error in creating Employee using API

Hi , i am not able to send the data to base table using the below mentioned code for employee using API:
--Declaration of Variables
DECLARE
--l_person_type_id integer;
l_per_object_version_number number;
l_asg_object_version_number number;
l_person_id number;
l_assignment_id number;
l_per_effective_start_date date;
l_per_effective_end_date date;
l_full_name varchar2(60);
l_per_comment_id number;
l_assignment_sequence number;
l_assignment_number varchar2(30);
l_name_combination_warning boolean;
l_assign_payroll_warning boolean;
l_emp_number varchar2(100);
v_ogi number;
v_bgi varchar2(100);
CURSOR g_valid_emp_cur
IS
SELECT *
FROM xyl_conv_employee_stg
WHERE error_flag = 'V';
Begin
--select business_group_id,organization_id  into v_bgi,v_ogi from hr_operating_units h where h. name=oraganization_name AND TRUNC (NVL (date_to, SYSDATE + 1)) > TRUNC (SYSDATE);
for valid_rec in g_valid_emp_cur
loop
select h.business_group_id,h.organization_id into v_bgi,v_ogi from hr_operating_units h where h.name='Vision Sweden' AND TRUNC (NVL (date_to, SYSDATE + 1)) > TRUNC (SYSDATE);
-- l_emp_number := valid_rec.employee_number;
dbms_output.put_line('Business Group Id' || v_bgi);
begin
hr_employee_api.create_employee
(p_validate => false
,p_hire_date => to_date(valid_rec.hire_date, 'dd/mon/yyyy')
,p_business_group_id => v_bgi
,p_last_name => valid_rec.last_name
,p_sex => valid_rec.sex
,p_date_of_birth => to_date(valid_rec.date_of_birth,'dd/mon/yyyy')
,p_employee_number => l_emp_number
,p_first_name => valid_rec.first_name
,p_nationality => null
-- p_person_type_id => l_person_type_id
,p_person_id => l_person_id
,p_assignment_id => l_assignment_id
,p_per_object_version_number => l_per_object_version_number
,p_asg_object_version_number => l_asg_object_version_number
,p_per_effective_start_date => l_per_effective_start_date
,p_per_effective_end_date => l_per_effective_end_date
,p_full_name => l_full_name
,p_per_comment_id => l_per_comment_id
,p_assignment_sequence => l_assignment_sequence
,p_assignment_number => l_assignment_number
,p_name_combination_warning => l_name_combination_warning
,p_assign_payroll_warning => l_assign_payroll_warning
commit;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
dbms_output.put_line(SQLERRM);
end;
end loop;
end;
SHOW ERR;
It says enter a person number. Any help would be appreciated.
Edited by: user8984055 on Feb 9, 2013 4:25 AM

Hi,
When you are doing the initial data migration at that stage you should set up the employee numbering and other numbering mechanism to manual. The reason of doing so is that when you are doing migration at that point you have the employee numbers with you for existing employees.
Once you data migration is done then you have to go to BG information and update the mechanism to Automatic. Also, if you numbering mechanism is automatic and you are not able to change to manual or vice-verse in the BG definition then use will have to use the concurrent program "Change Employee number mechanism". You will have to make the decision of changing from one type to another in a proper way.
Please find below some related articles on metalink for your reference
How to Change Employee Numbering from Manual to Automatic?     (Doc ID 292257.1)
Is it Possible to Update Generate Employee Number Method From Automatic to Manual?     (Doc ID 393827.1)
Unable to Switch From Auto to Manual for Employee Number Generation in Shared Hr     (Doc ID 452044.1)
How to control automatic employee numbering?     (Doc ID 473065.1)
Need To Change The Employee Numbering From Automatic To Manual     (Doc ID 291634.1)
Hope this helps.
Thanks,
Sanjay

Similar Messages

  • Error while creating Project using API - PA_PROJECT_PUB.CREATE_PROJECT

    I am working on Projects conversion and currently trying to create a project using the API.
    I have recetified all the errors it was giving and struck at 1 error. please find the error message below.
    "You have submitted invalid parameters to this process, preventing its successful completion. Please contact your system administrator."
    It gives me this error and I was not able to know the cause for this error. Please let me know how to bypass this error and go ahead with projects conversion???
    Attached below is my package:
    Thanks,
    Kesava
    =====================================================================================================================
    CREATE OR REPLACE PACKAGE xxbwp.xxbwp_pa_proj_conv_pkg AUTHID CURRENT_USER
    IS
         PROCEDURE xxbwp_pa_proj_conv_proc(errbuf           OUT      VARCHAR2
                             ,retcode           OUT      VARCHAR2);
    END xxbwp_pa_proj_conv_pkg;
    CREATE OR REPLACE PACKAGE BODY xxbwp.xxbwp_pa_proj_conv_pkg
    IS
         PROCEDURE xxbwp_pa_proj_conv_proc(errbuf           OUT      VARCHAR2
                             ,retcode           OUT      VARCHAR2)
         IS
    v_data VARCHAR2(2000);
    v_index_out NUMBER;
         v_msg_count               NUMBER;
         v_msg_data               VARCHAR2(2000);
         v_return_status               VARCHAR2(1);
         v_api_version_number          NUMBER          :=     1.0;
         v_commit               VARCHAR2(1)     :=     apps.fnd_api.g_false;
         v_init_msg_list               VARCHAR2(1)     :=      apps.fnd_api.g_false;
         v_workflow_started          VARCHAR2(1)      :=      'Y';
         v_pm_product_code          VARCHAR2(30)      :=      NULL;
         v_op_validate_flag          VARCHAR2(1)      :=      'Y';
         v_project_in               apps.pa_project_pub.project_in_rec_type;
         v_project_out               apps.pa_project_pub.project_out_rec_type;
         v_customers_in               apps.pa_project_pub.customer_tbl_type;
         v_key_members               apps.pa_project_pub.project_role_tbl_type;
         v_class_categories          apps.pa_project_pub.class_category_tbl_type;
         v_tasks_in               apps.pa_project_pub.task_in_tbl_type;
         v_tasks_in_rec apps.pa_project_pub.task_in_rec_type;
    v_tasks_out               apps.pa_project_pub.task_out_tbl_type;
         v_org_roles               apps.pa_project_pub.project_role_tbl_type;
         v_structure_in               apps.pa_project_pub.structure_in_rec_type;
         v_ext_attr_tbl_in          apps.pa_project_pub.pa_ext_attr_table_type;
         v_deliverables_in          apps.pa_project_pub.deliverable_in_tbl_type;
         v_deliverable_actions_in     apps.pa_project_pub.action_in_tbl_type;
    -- Variables declaration related to project_in_rec_type
    l_pm_project_reference VARCHAR2(25);
    l_pa_project_id NUMBER;
    l_pa_project_number VARCHAR2(25);
    l_segment1 VARCHAR2(25);
    l_project_name VARCHAR2(30);
    l_description VARCHAR2(250);
    l_long_name VARCHAR2(240);
    l_department_mapping VARCHAR2(50);
    l_department_mapping_c VARCHAR2(50);
    l_department_mapping_e VARCHAR2(50);
    l_created_from_project_id NUMBER;
    l_carrying_out_organization_id NUMBER;
    l_proj_start_date DATE;
    l_completion_date DATE;
    l_temp_project_type VARCHAR2(30);
    l_company_id VARCHAR2(10);
    l_company_id_c VARCHAR2(10);
    l_company_id_e VARCHAR2(10);
    l_proj_type VARCHAR2(30);
    l_cnt NUMBER := 0;
    l_task_cnt NUMBER := 0;
    l_responsibility_id NUMBER;
    l_application_id NUMBER;
    l_user_id NUMBER;
    l_global_info_msg_count NUMBER;
    l_global_info_msg_data VARCHAR2(2000);
    l_global_info_return_status VARCHAR2(1);
    CURSOR C1 IS
    SELECT *
    FROM xxbwp.xxbwp_pa_proj_conv_tbl
    WHERE proj_type = 'STORAGE';
    begin
    FOR C1_REC in C1
    LOOP
    SELECT APPS.pa_projects_s.nextval
    INTO l_pa_project_id
    FROM DUAL;
    BEGIN
    SELECT description
                   INTO     l_proj_type
                   FROM apps.fnd_lookup_values
                   WHERE lookup_type = 'BWP_PROJECT_TYPES_LKP'
                   AND     lookup_code = C1_REC.proj_type
                   AND     1 = 1;
    END;
    BEGIN
    SELECT project_id, project_type, carrying_out_organization_id
    INTO l_created_from_project_id, l_temp_project_type, l_carrying_out_organization_id
    FROM apps.pa_projects_all
    WHERE project_type = l_proj_type
    AND template_flag = 'Y';
    END;
    BEGIN
    SELECT rt.responsibility_id, rt.application_id
    INTO l_responsibility_id, l_application_id
    FROM apps.fnd_responsibility_tl rt
    WHERE rt.responsibility_name = 'BWP PA Projects Superuser';
    EXCEPTION WHEN OTHERS THEN
    RETURN;
    END;
    BEGIN
    SELECT u.user_id
    INTO l_user_id
    FROM APPS.fnd_user u
    WHERE u.user_name = 'CHUNDURK';
    EXCEPTION WHEN OTHERS THEN
    RETURN;
    END;
    -- Set the environment
    APPS.pa_interface_utils_pub.set_global_info
    (p_api_version_number => 1.0
    ,p_responsibility_id => l_responsibility_id
    ,p_user_id => l_user_id
    ,p_resp_appl_id => l_application_id
    ,p_msg_count => l_global_info_msg_count
    ,p_msg_data => l_global_info_msg_data
    ,p_return_status => l_global_info_return_status);
    --Assign values to project_in_rec_type
    v_project_in.pm_project_reference := C1_REC.PROJ_NUM;
    v_project_in.pa_project_id := l_pa_project_id;
    v_project_in.pa_project_number := C1_REC.PROJ_NUM;
    v_project_in.project_name := C1_REC.PROJ_NAME;
    v_project_in.description := NULL;
    v_project_in.long_name := C1_REC.PROJ_LONG_NAME;
    v_project_in.created_from_project_id := l_created_from_project_id;
    v_project_in.carrying_out_organization_id := l_carrying_out_organization_id;
    v_project_in.start_date := C1_REC.trans_start_date;
    v_project_in.completion_date := C1_REC.trans_end_date;
    v_project_in.scheduled_start_date := C1_REC.trans_start_date;
    v_project_in.scheduled_finish_date := C1_REC.trans_end_date;
    v_project_in.project_status_code := 'APPROVED';
    FOR x IN (SELECT person_id, project_role_type, start_date_active, end_date_active
    FROM apps.pa_project_players
    WHERE project_id = 262)
    LOOP
    APPS.fnd_file.put_line(APPS.FND_FILE.LOG,'PERSON ID '||x.person_id);
    APPS.fnd_file.put_line(APPS.FND_FILE.LOG,'PROJECT ROLE TYPE '||x.project_role_type);
    l_cnt := l_cnt + 1;
    v_key_members(l_cnt).person_id := x.person_id;
    v_key_members(l_cnt).project_role_type := x.project_role_type;
    v_key_members(l_cnt).start_date := x.start_date_active;
    v_key_members(l_cnt).end_date := x.end_date_active;
    END LOOP;
    -- Retrieving and assigning tasks from template to a project
    FOR x IN (SELECT task_id, parent_task_id, task_name, long_task_name, task_number, description,
    billable_flag, cint_eligible_flag, chargeable_flag
    FROM apps.pa_tasks t
    WHERE t.project_id = l_created_from_project_id
    START WITH parent_task_id IS NULL CONNECT BY PRIOR task_id = parent_task_id)
    LOOP
    l_task_cnt := l_task_cnt + 1;
    v_tasks_in_rec.pm_task_reference := x.task_id;
    v_tasks_in_rec.task_name := x.task_name;
    v_tasks_in_rec.long_task_name := x.long_task_name;
    v_tasks_in_rec.pa_task_number := x.task_number;
    v_tasks_in_rec.task_description := x.description;
    v_tasks_in_rec.task_start_date := C1_REC.trans_start_date;
    v_tasks_in_rec.task_completion_date := C1_REC.trans_end_date;
    v_tasks_in_rec.scheduled_start_date := C1_REC.trans_start_date;
    v_tasks_in_rec.scheduled_finish_date := C1_REC.trans_end_date;
    v_tasks_in_rec.pm_parent_task_reference := x.parent_task_id;
    v_tasks_in_rec.billable_flag := x.billable_flag;
    v_tasks_in_rec.cint_eligible_flag := x.cint_eligible_flag;
    v_tasks_in_rec.chargeable_flag := x.chargeable_flag;
    v_tasks_in_rec.tasks_dff := 'Y';
    v_tasks_in_rec.attribute1 := l_pa_project_id;
    v_tasks_in(l_task_cnt) := v_tasks_in_rec;
    END LOOP;
    v_class_categories(0).class_category := 'Reimbursable';
    v_class_categories(0).class_code := 'No';
    APPS.FND_MSG_PUB.initialize;
    apps.pa_project_pub.create_project
    (p_api_version_number => v_api_version_number
    ,p_commit => v_commit
    ,p_init_msg_list => v_init_msg_list
    ,p_msg_count => v_msg_count
    ,p_msg_data => v_msg_data
    ,p_return_status => v_return_status
    ,p_workflow_started => v_workflow_started
    ,p_pm_product_code => v_pm_product_code
    ,p_op_validate_flag => v_op_validate_flag
    ,p_project_in => v_project_in
    ,p_project_out => v_project_out
    ,p_customers_in => v_customers_in
    ,p_key_members => v_key_members
    ,p_class_categories => v_class_categories
    ,p_tasks_in => v_tasks_in
    ,p_tasks_out => v_tasks_out
    ,p_org_roles => v_org_roles
    ,p_structure_in => v_structure_in
    ,p_ext_attr_tbl_in => v_ext_attr_tbl_in
    ,p_deliverables_in => v_deliverables_in
    ,p_deliverable_actions_in => v_deliverable_actions_in
    APPS.fnd_file.put_line(APPS.FND_FILE.LOG,v_return_status||' '||v_msg_count);
    IF v_msg_count > 0 THEN
    FOR i in 1 .. v_msg_count
    LOOP
    apps.pa_interface_utils_pub.get_messages
    (p_encoded => 'F'
    ,p_msg_count => v_msg_count
    ,p_msg_index => i
    ,p_msg_data => v_msg_data
    ,p_data => v_data
    ,p_msg_index_out => v_index_out);
    APPS.fnd_file.put_line(APPS.FND_FILE.LOG,v_data);
    END LOOP;
    END IF;
    END LOOP;
    end xxbwp_pa_proj_conv_proc;
    end xxbwp_pa_proj_conv_pkg;
    show errors;
    Edited by: user644005 on Sep 11, 2009 11:02 AM

    Hi Kesava,
    I notice that in the package you used the application user_name=CHUNDUK calls the API pa_project_pub.create_project.
    I wonder if you used chunduk as database user to execute the package Or you used APPS to execute the package?
    The APi document states that it is a requirement to create a db username as the same name with the application username.
    I have been running the problem to execute API 's delete project and try to figure what could be my problem.
    TIA

  • Error while creating stock using tcode: MB1C

    Error while creating stock using tcode: MB1C
    The Error is: Check table T004F:entry G006 does not exist

    Hi ,
    Please check the FSV (field status variant) for your company code in OBY6 .
    then go to transaction code OB14 --> enter the FSV --> Check if field status group G006(Material account) is maintained there or not.
    if not please maintain it.
    Thanks & Regards
    Anshu

  • Getting error while creating subsite using custom template in sharepoint2013

    Hi,
    I am getting the following error while creating subsite using custom template in sharpoint2013. even publish features are enabled.
    Please suggest me on this.
    Thanks in advance.

    You need to enable the PerformancePoint Service Site Collection Features(PPSMonDatasourceCtype)
    on the target site collection. go to site action > site settings> site collections features > and enable it and now try again.
    Similar case: http://imughal.wordpress.com/2012/09/20/dependency-feature-ppsmondatasourcectype-id-05891451-f0c4-4d4e-81b1-0dabd840bad4-for-feature-bicenterdataconnections-id-3d8210e9-1e89-4f12-98ef-643995339ed4-is-not-activated-at-this-scop/
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Error in creating GUID using com.sap.guid API's

    Hi
       i am trying to create GUID using com.sap.guid API's. I've included the guidgenerator.jar in the classpath. I ran the following code. i got the "Caused by: java.lang.NoClassDefFoundError: com/sap/guid/GUIDGeneratorFactory " error.
    the code is
    package com.portal;
    import com.sapportals.portal.prt.component.;*
    import com.sap.guid.GUIDGeneratorFactory;
    import com.sap.guid.IGUID;
    import com.sap.guid.IGUIDGenerator;
    import com.sap.guid.IGUIDGeneratorFactory;
    public class TestCompforGUID extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    *          IGUIDGenerator generator = GUIDGeneratorFactory.getInstance().createGUIDGenerator();*
    *          String guid = generator.createGUID().toString();*
    *          String hexGuid = generator.createGUID().toHexString();*
    *          response.write(guid);*
    *          response.write(hexGuid);*
    can anyone created the GUID's using com.sap.guid API's and help me here.
    Do i need to specify any reference in Portalapp.xml ?
    Thanks,
    Saravanan

    difficult to reproduce. But it might be a data conversion problem.
    e.g. try
    to_char(a.num_tabs)If that's not the error comment out certain lines or xmltags and test which one is the reason for the error.
    Edited by: Sven W. on Sep 9, 2011 3:13 PM - typo correction

  • Getting Error while creating Project through API:PA_PROJECT_PUB.CREATE_PROJ

    Hi Gurus,
    I'm getting an error while creating a New project.
    My code looks like this:
    APPS.PA_PROJECT_PUB.CREATE_PROJECT
    (p_api_version_number => l_object_version_number --IN Parameter
    ,p_commit => l_commit --IN Parameter
    ,p_init_msg_list => l_init_msg_list --IN Parameter
    ,p_msg_count => l_msg_count --OUT Parameter
    ,p_msg_data => l_msg_data --OUT Parameter
    ,p_return_status => l_return_status --OUT Parameter
    ,p_workflow_started => l_workflow_started --OUT Parameter
    ,p_pm_product_code => g_pm_product_code --IN Parameter
    ,p_op_validate_flag => l_op_validate_flag --IN Parameter
    ,p_project_in => g_project_in --IN Parameter
    ,p_project_out => g_project_out --OUT Parameter
    ,p_tasks_in => g_task_in --IN Parameter
    ,p_tasks_out => g_task_out --OUT Parameter
    The out put params are: p_msg_count => 1
    p_return_status => E
    p_workflow_started => N
    g_project_out.pa_project_id => 170000000000000000000
    g_project_out.pa_project_number => ^
    g_task_out_rec.pa_task_id => 170000000000000000000
    End process record p_proj_insert => 1
    Resetting the task count variable
    when I checked the API code I found this:
    PA_INTERFACE_UTILS_PUB.G_PROJECt_ID := null; --bug 2471668 ( not in the project context )
    PA_PM_FUNCTION_SECURITY_PUB.check_function_security
    (p_api_version_number => p_api_version_number,
    p_responsibility_id => l_resp_id,
    p_function_name => 'PA_PM_CREATE_PROJECT',
    p_msg_count => l_msg_count,
    p_msg_data => l_msg_data,
    p_return_status => l_return_status,
    p_function_allowed => l_function_allowed
    . I think I am getting the error because of this.
    Now, question.
    Do I need to run the Create Project from a specific Responsibility?
    because when I ran the underlined query, I fpound the final status as 'N'.
    I'm a HR guy and PA is a new world for me. Any help will be appreciated.
    Thanks!!
    Viky

    You need to find any responsibility and userid that lets you create a project using the screen.
    And then in your code, you need to set your context to that resp/userid.
    Hope this helps
    Sandeep Gandhi

  • Error while creating SR using CS_ServiceRequest_PUB.Create_ServiceRequest

    Hi All,
    I am getting below error while creating an SR from the backend using API 'CS_ServiceRequest_PUB'.
    Error:
    API Programming Error (CS_ServiceRequest_PUB.Create_ServiceRequest): An error occurred when validating the descriptive flexfield.
    Additional information:Program error: Please inform your support representative that:
    FLEXFIELDS SERVER-SIDE VALIDATION package reports error:
    validate_desccols() exception: ORA-20005: DVLB.get_default_context() failed. SQLERRM: ORA-01403: no data found
    ORA-06512: at "APPS.FND_FLEX_DESCVAL", line 931
    ORA-01403: no data found
    Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    I have intialised the context as below while running the stand alone procedure in SQL Developer.
    Fnd_Global.apps_initialize (user_id => 1368347,
    resp_id => 21739
    resp_appl_id => 514 );
    We are on 11.5.10.2 and database version is 9i.
    Can you please help??
    TIA,
    S

    Hi Kesava,
    I notice that in the package you used the application user_name=CHUNDUK calls the API pa_project_pub.create_project.
    I wonder if you used chunduk as database user to execute the package Or you used APPS to execute the package?
    The APi document states that it is a requirement to create a db username as the same name with the application username.
    I have been running the problem to execute API 's delete project and try to figure what could be my problem.
    TIA

  • Error while creating Employee in 11i

    Hi All,
    I am using Oracle applications 11i in my PC for trying purpose in Windows 2003 environment. I have HRMS in my APPS. While creating Employee in US HR manager >
    I am getting the following error message.
    App-Per-52803 Business Group Does Not Match Security Profile
    For this i got resolution from Metalink, as per metalink:
    HR:Business Group and
    HR:Security Profile
    Both are same profile options. I have checked in profiles both are set to Vision corporations. But i am getting same error still. Could any one please suggest me.
    Thanks,
    RED.

    RED,
    I am not aware of any other solution that could be helpful here. However, I suggest you review the following note and see if it helps.
    Note: 205502.1 - HRMS Security Implementation Issues
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=205502.1
    If the above note is irrelevant here, please log a SR.
    Regards,
    Hussein

  • Error in creating JE using SDK

    I am using B1 2004 B and trying to create JE using SDk(vb6).I am getting the following error:
    [OJDT.BtfStatus][line: 2] , 'Row in Transaction with Account No.'
    Following is my code:
    Dim vJE As SAPbobsCOM.JournalEntries
    Set vJE = oCmp.GetBusinessObject(oJournalEntries)
    vJE.Lines.AccountCode = "500005"
    vJE.Lines.ContraAccount = "131000"
    vJE.Lines.Credit = 0
    vJE.Lines.Debit = dblAmount
    Call vJE.Lines.Add
    vJE.Lines.AccountCode = "C003"
    vJE.Lines.ContraAccount = "400000"
    vJE.Lines.Credit = 0
    vJE.Lines.Debit = (dblAmount * 105) / 100
    vJE.Add()   
    B1 gurus please help.
    Thanks

    When you encounter a problem when working with DI API, please remember that you should try to do the same in the SAP Business One application!
    In your case the first thing which is wrong is that at least one of the account codes in the second line is wrong (AccountCode or ContraAccount); unfortunately the error message does not really tell you that, but this happens quite often in software development.
    Secondly the principle of journal entries is to have a "balanced transaction", i.e. <total of Debit(s)> = <total of Credit(s)>... (this will be the next error you will be running into).
    I recommend that you check-out the material in the Developer Area on this site (https://www.sdn.sap.com/sdn/developerareas/businessone.sdn?node=linkDnode10) + check-out the SAP Business One-related material in the Education area in the SMB Portal on SAP Service Marketplace (http://service.sap.com/smb)...
    HTH,
    Frank

  • Logical error in creating tables using db link in solaris

    Hi,
    While creating table using the syntax create table newtab...as select * from tab@dblink .. I am facing a problem. The newtab table created is having a structure different (from datalength point of view of varchar2 and char datatypes) from the source. The data length is getting tripled i.e. if a column a is varchar2(20) in tab then it is becoming --- a varchar2(60) in newtab. This is happening in solaris environment when the two databases are in 2 different servers. Please let me know if there are any patches to resolve the problem.
    Thanks
    Arnab

    ORA-02019: connection description for remote database not foundHave you used this database link successfully for some other queries?
    The error posted seems to indicate that the DB Link is not functional at all. Has it worked for any other type of DML operation or is this the first time you ever tried to use the link?

  • Error while creating Salesorder using BAPI

    hello frnds,
    I m new to abap and tryin to make use of BAPI_SALESORDER_CREATEFROMDAT1 to create Sales Order
    I have used the progrtam below.
    *& Report  ZSALESBAPITRIAL
    REPORT  zsalesbapitrial.
    TABLES : vbak , vbap.
    Parameter Screen.
    Sales Document Type.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    Sales document type.
    PARAMETERS: p_auart TYPE vbak-auart OBLIGATORY.
    Sales Organisation.
    PARAMETERS: p_vkorg TYPE vbak-vkorg OBLIGATORY.
    Distribution channel.
    PARAMETERS: p_vtweg TYPE vbak-vtweg OBLIGATORY.
    Division.
    PARAMETERS: p_spart TYPE vbak-spart OBLIGATORY.
    SKIP 1.
    Sold to.
    PARAMETERS: p_sold TYPE vbak-kunnr OBLIGATORY.
    Ship to.
    PARAMETERS: p_ship TYPE vbak-kunnr OBLIGATORY.
    SKIP 1.
    Material(Article No).
    PARAMETERS: p_matnr TYPE vbap-matnr   OBLIGATORY.
    Quantity (Cummulative quantity of sales Order)
    PARAMETERS: p_menge type vbap-kwmeng obligatory.
    Plant(Site )
    parameters: p_plant type vbap-werks obligatory.
    SELECTION-SCREEN END OF BLOCK b1.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
    EXPORTING
    sales_header_in = header
    sales_header_inx = headerx
    IMPORTING
    salesdocument_ex = v_vbeln
    TABLES
    return = return
    sales_items_in = item
    sales_items_inx = itemx
    sales_schedules_in = lt_schedules_in
    sales_schedules_inx = lt_schedules_inx
    sales_partners = partner.
    Check the return table.
    LOOP AT return WHERE type = 'E' OR type = 'A'.
    EXIT.
    ENDLOOP.
    IF sy-subrc = 0.
    WRITE: / 'Error in creating document'.
    ELSE.
    WRITE: / 'Document ', v_vbeln, ' created'.
    ENDIF.
    but its giving 'Error in creating document' I m unable to figure wat i m missing . Is it tht i m gving wrong parameters.
    Please help !!!

    Does tht mean i need to add the following code
    Line item number.
    item-itm_number = '000010'.
    itemx-itm_number = 'X'.
    Material
    item-material = p_matnr.
    itemx-material = 'X'.
    Plant
    item-plant    = p_plant.
    itemx-plant   = 'X'.
    Quantity
    item-target_qty = p_menge.
    itemx-target_qty = 'X'.
    APPEND item.
    APPEND itemx.
    For second item.
    Line item number.
    item-itm_number = '000020'.
    itemx-itm_number = 'X'.
    Material
    item-material = '600020001'.
    itemx-material = 'X'.
    Plant
    item-plant    = p_plant.
    itemx-plant   = 'X'.
    Quantity
    item-target_qty = p_menge.
    itemx-target_qty = 'X'.
    APPEND item.
    APPEND itemx.
      Fill schedule lines
    lt_schedules_in-itm_number = '000010'.
    lt_schedules_in-sched_line = '0001'.
    lt_schedules_in-req_qty    = p_menge.
    APPEND lt_schedules_in.
      Fill schedule lines
    lt_schedules_in-itm_number = '000020'.
    lt_schedules_in-sched_line = '0002'.
    lt_schedules_in-req_qty    = p_menge.
    APPEND lt_schedules_in.
      Fill schedule line flags
    lt_schedules_inx-itm_number  = '000010'.
    lt_schedules_inx-sched_line  = '0001'.
    lt_schedules_inx-updateflag  = 'X'.
    lt_schedules_inx-req_qty     = 'X'.
    APPEND lt_schedules_inx.
      Fill schedule line flags
    lt_schedules_inx-itm_number  = '000020'.
    lt_schedules_inx-sched_line  = '0002'.
    lt_schedules_inx-updateflag  = 'X'.
    lt_schedules_inx-req_qty     = 'X'.
    APPEND lt_schedules_inx.
    But i guess it is overwritting my frst material..
    Also i m gettin a error 
    For object rv_beleg, number  range interval doesnot exist
    Pls suggest

  • Error while creating Resource using GDS

    Hi
    Iam trying to create Resource using GDS and it is throwing me error
    clresource: (C189917) VALIDATE on resource egateq00-haegate_reg-res, resource group egateq00-rg, exited with non-zero exit status.
    clresource: (C720144) Validation of resource egateq00-haegate_reg-res in resource group egateq00-rg on node uhegateq02 failed.
    clresource: (C891200) Failed to create resource "egateq00-haegate_reg-res".
    This is the command I executed
    rclresource create -g egateq00-rg -t SUNW.gds
    -p Scalable=false -p Start_timeout=120 -p Stop_timeout=120 -p Probe_timeout=30
    -p Port_list="23001/tcp" -p Start_command="/egateq00/scripts/reg_START.sh" -p Stop_command="/egateq00/scripts/reg_STOP.sh"
    -p Probe_command="/egateq00/scripts/reg_PROBE.sh" -p Child_mon_level=1 -p Network_resources_used=egateq00-lh-res -p Failover_enabled=FALSE
    -p Stop_signal=15 egateq00-haegate_reg-res
    The log under /var/cluster/logs/DS says following
    07/01/2008 17:56:43 uhegateq02 START-INFO> scha_resource_open failed [14]. Keeping the old Log_level value
    07/01/2008 17:56:43 uhegateq02 START-ERROR> Cannot access the start command </egateq00/scripts/reg_START.sh> : <No such file or directory>
    07/01/2008 18:13:23 uhegateq02 START-INFO> scha_resource_open failed [14]. Keeping the old Log_level value
    07/01/2008 18:13:23 uhegateq02 START-ERROR> Cannot access the start command </egateq00/scripts/reg_START.sh> : <No such file or directory>
    However, I can open these scripts and run it from anywhere. I also tested these scripts and they all work fine. They are all set to chmod 777 , so everyone should have execute permission
    Iam not returning any return value from these Start and Stop script , is that the why it is failing
    thanks

    Hi
    I disabled the PMF as described on the http://blogs.sun.com/TF/entry/disabling_pmf_action_script_with. This is what I did
    1>Added following line in the top of my Start script
    while getopts 'R:G:' opt
    do
    case "${opt}" in
    R) RESOURCE=${OPTARG};;
    G) RESOURCEGROUP=${OPTARG};;
    esac
    done
    sleep 60 &
    /usr/cluster/bin/pmfadm -s ${RESOURCEGROUP},${RESOURCE},0.svc
    2>While creating the resource , I used property for Start_command="/egateq00/scripts/reg_START.sh -R %RS_NAME -G %RG_NAME"
    Now , after doing this , My RG is not getting lost. Also , in the message file I do not see the errors of "Start script failed to stay UP"
    However, My Application is not started either.
    This is what the message file says
    Jul 3 16:43:32 uhegateq01 Cluster.RGM.rgmd: [ID 515159 daemon.notice] method <gds_validate> completed successfully for resource <egateq00-haegat
    e-reg-res>, resource group <egateq00-rg>, node <uhegateq01>, time used: 0% of timeout <300 seconds>
    Jul 3 16:43:32 uhegateq01 Cluster.CCR: [ID 973933 daemon.notice] resource egateq00-haegate-reg-res added.
    Jul 3 16:43:32 uhegateq01 Cluster.RGM.rgmd: [ID 224900 daemon.notice] launching method <gds_svc_start> for resource <egateq00-haegate-reg-res>,
    resource group <egateq00-rg>, node <uhegateq01>, timeout <120> seconds
    Jul 3 16:43:32 uhegateq01 Cluster.RGM.rgmd: [ID 252072 daemon.notice] 50 fe_rpc_command: cmd_type(enum):<1>:cmd=</opt/SUNWscgds/bin/gds_svc_star
    t>:tag=<egateq00-rg.egateq00-haegate-reg-res.0>: Calling security_clnt_connect(..., host=<uhegateq01>, sec_type {0:WEAK, 1:STRONG, 2:DES} =<1>, .
    Jul 3 16:43:35 uhegateq01 Cluster.RGM.rgmd: [ID 515159 daemon.notice] method <gds_svc_start> completed successfully for resource <egateq00-haega
    te-reg-res>, resource group <egateq00-rg>, node <uhegateq01>, time used: 2% of timeout <120 seconds>
    Jul 3 16:43:35 uhegateq01 Cluster.RGM.rgmd: [ID 224900 daemon.notice] launching method <gds_monitor_start> for resource <egateq00-haegate-reg-re
    s>, resource group <egateq00-rg>, node <uhegateq01>, timeout <300> seconds
    Jul 3 16:43:35 uhegateq01 Cluster.RGM.rgmd: [ID 252072 daemon.notice] 50 fe_rpc_command: cmd_type(enum):<1>:cmd=</opt/SUNWscgds/bin/gds_monitor_
    start>:tag=<egateq00-rg.egateq00-haegate-reg-res.7>: Calling security_clnt_connect(..., host=<uhegateq01>, sec_type {0:WEAK, 1:STRONG, 2:DES} =<1
    , ...)Jul 3 16:43:35 uhegateq01 Cluster.RGM.rgmd: [ID 515159 daemon.notice] method <gds_monitor_start> completed successfully for resource <egateq00-h
    aegate-reg-res>, resource group <egateq00-rg>, node <uhegateq01>, time used: 0% of timeout <300 seconds>
    4>Also , in the /var/cluster/logs/DS , I see the Start script started succesfully
    07/03/2008 16:43:32 uhegateq01 START-INFO> Start succeeded. [egateq00/scripts/reg_START.sh -R egateq00-haegate-reg-res -G egateq00-rg]
    5>Also , in the /var/cluster/logs/DS , I see the Probe script returning 0 , but this is wierd because it should return Non zero number. When I run the Probe script from the command line , it is returning me non zero value when the application is down
    07/03/2008 16:43:35 uhegateq01 PROBE-INFO> The GDS monitor (gds_probe) has been started
    07/03/2008 16:44:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:44:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:45:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:45:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:46:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:46:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:47:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:47:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:48:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:48:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:49:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:49:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:50:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:50:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:51:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:51:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:52:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:52:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:53:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:53:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:54:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:54:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:55:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:55:35 uhegateq01 PROBE-INFO> The probe result is 0
    07/03/2008 16:56:35 uhegateq01 PROBE-INFO> Probe has been executed with exit code 0 [egateq00/scripts/reg_PROBE.sh]
    07/03/2008 16:56:35 uhegateq01 PROBE-INFO> The probe result is 0

  • Error while creating Routing using LSMW

    Hi Guys ,
    I am trying to create LSMW using Direct Input Method .
    My structures are ::
    RC271_DS   Work center structure for direct input (for datasets)
    RC27M_DS   Material master view DIRECT INPUT routing for datasets
    PLKO_DI_DS Header structure for direct input (for datasets)
    PLPO_DI_DS Routing/item structure for direct input (for datasets.
    I getting correct data from multiple flat files .
    It's converting the data also .
    But while executing start direct input method i am getting the followig error ....
    You cannot edit the task list object with activity type
    Please let me know problem guys .
    Regards,
    Raj

    Hi Naveen,
    It means you have to assign  the task list type to  material type ZPRD. Then it will carry its job:
    The path is:
    Go To-> SPRO-> IMG Activity-> Production-> Basic Data-> Routing-> General Data---> Define Material Type Assignments. T-Code: OP50
    I hope it will work.
    Regards,
    Madhu.G

  • Error while creating BOM using BAPI 'BAPI_BOM_UPLOAD_SAVE'

    Hi All,
    We are getting an error as 'Data is incomplete' while trying to create BoM using the bapi 'BAPI_BOM_UPLOAD_SAVE', if the item contains Item category as 'T'. But for other item category like 'L' or 'N', the bapi is sucessfull.
    The values that we pass to fill the item category 'T' are operation, item_cat, bom_itm_no, COMPON_QTY, FIXED_QTY as 'X', UNMEAS as 'ST', ITEM_TEXT1 and ITEM_TEXT2.
    Anyone who has faced same problem or has a solution to the problem, kindly provide a solution.
    Regards,
    Vijay

    The error you receive is because of different config for different Item Categories. Find out from the functional team what fields have they kept mandatory for the item category 'T'. You may not be passing one of those fields in the BAPI.
    Try creating a BOM manually for item category 'T' and you may figure our which field you are missing.

  • Error while creating AW using DBMS_LOB with XML..

    Hi All,
    I am trying to create AW using DBMS_LOB package with XML,
    while creating AW,i am facing the following error.find the code also below :
    declare
    xml_awcreate_clob clob;
    xml_awcreate_st varchar2(4000);
    begin
    DBMS_LOB.CREATETEMPORARY(xml_awcreate_clob,TRUE);
    dbms_lob.open(xml_awcreate_clob, DBMS_LOB.LOB_READWRITE);
    dbms_lob.writeappend(xml_awcreate_clob, 48, '<?xml version = ''1.0'' encoding = ''UTF-8'' ?>');
    dbms_lob.writeappend(xml_awcreate_clob, 43, '');
    dbms_lob.writeappend(xml_awcreate_clob, 63, '<AWXML version = ''1.0'' timestamp = ''Mon Feb 11 13:29:11 2002'' >');
    dbms_lob.writeappend(xml_awcreate_clob, 15, '<AWXML.content>');
    dbms_lob.writeappend(xml_awcreate_clob, 25, ' <Create Id="Action41">');
    dbms_lob.writeappend(xml_awcreate_clob, 19, ' <ActiveObject >');
    dbms_lob.writeappend(xml_awcreate_clob, 163, ' <AW Name="NEW_XML_AW" LongName="NEW_XML_AW" ShortName="NEW_XML_AW" PluralName="NEW_XML_AW" Id="NEW_XML.AW"/>');
    dbms_lob.writeappend(xml_awcreate_clob, 19, ' </ActiveObject>');
    dbms_lob.writeappend(xml_awcreate_clob, 11, ' </Create>');
    dbms_lob.writeappend(xml_awcreate_clob, 16, '</AWXML.content>');
    dbms_lob.writeappend(xml_awcreate_clob, 8, '</AWXML>');
    dbms_lob.close(xml_awcreate_clob);
    xml_awcreate_st := sys.interactionExecute(xml_awcreate_clob);
    end;
    ORA-21560: argument 2 is null, invalid, or out of range
    ORA-06512: at "SYS.DBMS_LOB", line 833
    ORA-06512: at line 12
    Any idea or thought on this would be appreciable.
    Thanks in advance.
    Anwar

    Did you change any of the text in the lob write statements ?
    I believe you get this error if you increase the number of characters without increasing the 1st argument which looks as though it represents the number of characters

Maybe you are looking for