Problem while creating WBS elements using LSMW
Hello experts,
I am able to create Project Definitions using LSMW. (using recording)
But there is a problem while creating WBS elements.
Tcode CJ20 has table control and that will become problem for multiple rows (levels).
Can anyone suggest a solution to mass upload WBS elements?
Thanks for your valuable advice.
Hi,
Instead of using "BAPI_PROJECT_MAINTAIN", use following solution. We are using this solution and it is working pretty good.
If the WBS element is already created and you want to create one more with same data, first get the WBS related information using BAPI_PROJECT_GETINFO as you are doing currently.
I am using different sets of BAPIs to create project, create / change WBS element.
I use function module from Function group CJ2001 ( Project related BAPIs ), CJ2054 ( WBS related BAPIs ) and PS_BAPI ( pre/post processing BAPIs ). There are specific order in which you need to execute these BAPIs.
For example if you want to create / change the WBS element, the BAPIs sequence is:
<b>1. BAPI_PS_INITIALIZATION
2. BAPI_BUS2054_CREATE_MULTI ( to create WBS )
or
2. BAPI_BUS2054_CHANGE_MULTI ( to change WBS )
3. BAPI_PS_PRECOMMIT
4. BAPI_TRANSACTION_COMMIT</b>
Check the documentation of BAPI "BAPI_BUS2054_CREATE_MULTI " to see how these function modules work.
Let me know if you need further information.
Regards,
RS
Similar Messages
-
Error while Creating WBS element using BAPI 'BAPI_BUS2054_CREATE_MULTI'
Hi Expert,
I've a requirement to create WBS elements using BAPI. And I am using BAPIs in the following manner.
CALL FUNCTION 'BAPI_PS_INITIALIZATION'
CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
EXPORTING
i_project_definition = g_pdwbs
TABLES
it_wbs_element = it_wbs_element
et_return = it_return
EXTENSIONIN =
EXTENSIONOUT =
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
When I do so I am getting the below errors. Please suggest.
"Individual check for creating the object WBS Element C-497082 required ".
"Individual check for creating the object WBS Element C-497082-0001 required".
Please suggest how to correct this error.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Edited by: Alvaro Tejada Galindo on Aug 18, 2008 5:25 PMI am getting the same error, but I cannot figure it out how to detect it and fix it. Will you please share your solution?
Thanks, -
Error while creating WBS element.. regarding source structure
I am creating a project and then a WBS element. Its a investment project. While creating WBS element XXX, it gives me error that "WBS element XXX: SOurce assignments for source structure A1 missing in Investment Profile ZZZZZ."
What shall I check? what could be the reason?
Thanks,
Ahi,
In this IMG activity, you define the source structures used when settling and costing joint products.
A source structure contains several source assignments, each of which contains the individual cost elements or cost element intervals to be settled using the same distribution rules
Just consult with your CO Consultant...
Venkatesh -
Creating WBS element using bapi BAPI_PS_INITIALIZATION
Hi All,
I have created Project definition successfully using function module "BAPI_PROJECT_MAINTAIN" .
But while trying to create Wbs-Element for the project definition using same function module "BAPI_PROJECT_MAINTAIN" we are getting the following error
Key does not correspond to mask: TR.XXXXX.X.X.XXX
Could any one help me out to resolve this issue.
Thanks in advance.
harsha pHi harsha p,
Error CJ609 "Key does not correspond to mask:TR.XXXXX.X.X.XXX" is always caused by an inconsistency between the project/WBS object number and the coding mask. Therefore, to solve the problem can you please try to run report ZZADJUSTPOSID from note 453280 attached?
The report should be imported into your system manually by SE38.
Please run it first in test mode to check the wrong entries and then correct them in update mode.
Best Regards,
Edna -
BAPI_BUS2054_CREATE_MULTI error while creating WBS Element
Hi Gurus,
I am trying to create WBS element by using BAPI_BUS2054_CREATE_MULTI
but bapi raise an error that I can not understand.
in return table I got the following error with the error code CJ - 021
" XXXX-YYYY-ZZZZ WBS Element does not exist "
But I try to create already? What does 'Does not exist' mean?
By the way I am using
CALL FUNCTION 'BAPI_PS_INITIALIZATION'. before using BAPI_BUS2054_CREATE_MULTI
thanks in advance, it is an very important
Mehmet AliHi.
I have the same problem. Have you solved?
Thanks.
Angie -
Delivery Date error while creating/uploading POs using LSMW
Hi,
I am facing problem in creating POs using LSMW. I am using direct input method with standard object 0085 for PO upload. But I am facing problem because of delivery date in the PO. There are basically two errors that I am getting:
1) When the delivery date format is DDMMYYYY in the fileto be uploaded, the error that i get is "Please enter a valid delivery date"(Message No..ME 077)
2) When the delivery date format is YYYYMMDD in the file to be uploaded, the error that i get isFor the K4 fiscal year variant, no period is defined for . .(Mesage no. F5 275)
Please let me know how to rectify these errors.
Thanks in advance.....Hi,
You need to rectify the issue by applying attached corrections in SAP Note 1094336 - Error message F5 275 if requirement date is deleted.
Summary
Symptom
The "Requirement date" field (EBAN-BADAT) was set to changeable in the the field selection. If the "Requirement date" field is deleted for a purchase requisition item, the system issues error message F5275 "For the xxx fiscal year variant, no period is defined for 00.00.0000".
You can leave the process only with /n.
Other terms
BADAT, requirement date, F5 275, EF5275, E F5 275
Reason and Prerequisites
Usability
Solution
Implement the program corrections.
Regards,
Sandesh Sawant -
Starnge problem while creating container elements in BPM
Hi All,
I am trying to create Container element of category Abstract Interface in BPM. While I try to give Type as the abstract interface created, it not populating the my abstract interface and says: No obects found.
Kindly, What could be the reason?
Thx
NavinHi,
You can use abstract sync inteface in the async-sync bridge (sender), using the async abstract interfaces as request and response to the sync abstract interface in the BPM sender properties configuration.
Regards,
Bill -
Problem While Creating Physical Standby Using RMAN
Hi Guru's
May be this incidence you all face while creating physical standby DB. I try to create Physical standby database Using RMAN Duplicate Command from one server
(pri machine) to Standby Machine.
The steps i followed to create the above are as follows:
Step 1:- Enable Forced Logging
SQL> ALTER DATABASE FORCE LOGGING;
Step 2:- Configure a Standby Redo Log
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 10
2> ('/oracle/dbs/log1c.rdo','/oracle/dbs/log2c.rdo') SIZE 500M;
Step 3:- Set Primary Database Initialization Parameters
SQL> create pfile='?/dbs/pfileorcl.ora' from spfile;
Edit the pfile to add the standby parameters, here shown:
db_unique_name='orcl'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,orcldr)'
LOG_ARCHIVE_DEST_2='SERVICE=orcldr LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcldr'
*.fal_server=orcldr
*.fal_client=orcl
*.standby_file_management=auto
Step 4:- Enable Archiving
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;
Step 5:- Setup tnsnames for standby database
This should be done on primary database by altering tnsnames.ora or using NetCA command, and create it by the name orcldr
orcldr =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby-svr)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcldr)
Step 6:- Backup database and copy it to standby
This backup script should be run on primary and copied to standby on the same mount point, running this scripts using RMAN, all files under /rman_backup should be copied to /rman_backup on standby server.
$rman target /
RMAN> run
allocate channel c1 type disk;
allocate channel c2 type disk;
backup database format '/rman_backup/%U';
backup archivelog all format '/rman_backup /%U';
backup current controlfile for standby format '/rman_backup/%U';
Step 7:- Standby Database Steps
Installing Oracle Software
This should be same release and patchset with exactly same ORACLE_HOME mount point.
Setting Up listener
Create and start a listener on standby database using NetCA, or creating listener.ora in $ORACLE_HOME/network/admin
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby-svr)(PORT = 1521))
Step 8:- Set Standby Database Initialization Parameters
Copying the pfile created in primary database and renames it to initorcldr.ora, and changes these parameters:
db_unique_name='orcldr'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcldr,orcl)'
LOG_ARCHIVE_DEST_2='SERVICE=orcl LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl'
*.fal_server=orcl
*.fal_client=orcldr
*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'
Step 9:- Setup tnsnames for primary database
This should be done on standby database by altering tnsnames.ora or using NetCA command, and create it by the name orcl
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = primary-svr)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
Step 10:- Copy a Password File
A password file must be created on the Primary and copied over to the Standby site. The sys password must be identical on both sites. Copy orapworcl to $ORACLE_HOME/dbs and rename file to orapworcldr
Step 11:- Create mount points for Oracle
Mount point should be created on standby server with the same convention used in primary, this includes the location for controlfiles, redo logs, datafiles, archive log destination and alert logs.
$ mkdir -p /u01/app/oracle/oradata/orcl/
$ mkdir -p /u01/app/oracle/flash_recovery_area/
$ mkdir -p /u01/app/oracle/admin/orcl/adump
$ mkdir -p /u01/app/oracle/admin/orcl/bdump
$ mkdir -p /u01/app/oracle/admin/orcl/cdump
$ mkdir -p /u01/app/oracle/admin/orcl/udump
Step 12:- Use RMAN to restore backup and setup standby
Connect to RMAN and execute the following command to create standby database, this should be performed on standby server after copying backup and setting tnsnames.
$ export ORACLE_SID=orcldr
$ rman target sys/tiger@orcl auxiliary sys/tiger@orcldr
RMAN> duplicate target database for standby dorecover;
Here i am getting problem as :
While trying to connect to traget database and auxiliary database i notice that when RMAN is connect to both databases it shows
orcl ( DBID xyz)
orcl (not mounted)
Here in my view the second database must be standby database name or auxiiary db name is standby db name which in my case is orcldr
after this issue i am facing the second issues as :
in command
duplicate target database for standby dorecover;
After modifying the command to
RMAN> duplicate target database to "standby";
rman-05520 database name mismatch
Can u please let me know where i am mistakingok for pri:
db_name=orcl
db_unique_name=orcl
for standby:
db_name=orcl
db_unique_name=sbyorcl ( i change orcldr to sbyorcl later)for new testing
but now what i am getting on
Verify connectivity
On Primary Server:
C:\> lsnrctl stop LISTENERI (working fine)
C:\> lsnrctl start LISTENER (working fine)
C:\> tnsping orcl (working fine)
C:\> tnsping sbyorcl (working fine)
C:\> sqlplus sys/xxxxx@orcl (working fine)
C:\> sqlplus sys/xxxxx@sbyorcl (not working fine)
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
On Standby Server:
C:\>lsnrctl stop LISTENER
C:\> lsnrctl start LISTENER
C:\> tnsping orcl
C:\> tnsping sbyorcl
C:\> sqlplus sys/xxxxx@orcl
C:\> sqlplus sys/xxxxx@sbyorcl
My listner file for pri :-
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(SID_NAME = ORCL)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.129)(PORT = 1521))
tnsnames.ora file on pri is:
sbyorcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.128)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = sbyorcl)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.129)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
and listener file on standby :
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(SID_NAME = orcl)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.128)(PORT = 1521))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
and tnsnames.ora file on standby:
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.128)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
sbyorcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.202.129)(PORT = 1521))
(CONNECT_DATA =
SERVICE_NAME = sbyorcl)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
Kinldy guide me where i am mistaking it's urgent -
Problem while creating service PO using bapi_po_create1
hi all,
i am getting error :
In case of account assignment, please enter acc. assignment data for item
what does this mean?
please help,,
thanks,
Siddhartha PrakashHi Sid.
I'm having this same problems on creating PO Service. Did you solve it? How did you do that?
I'm using a PR and the Category is 'Y', and I cant find where is the problem.
The tables that I'm passing to the BAPI_PO_CREATE1 are:
POITEM/ POITEMX
POACCOUNT/ POACCOUNTX
POSERVICES
POSRVACCESSVALUES
Please, if you have any idea, let me know!
Tks a lot!
Renata -
Problem while creating partner link using https URL
Hi,
To create the partnerlink using https URL, I had done the following:
-Imported the self signed certificate into the OraBPELPM_\jdk\jre\lib\security\cacert
-Added following entries in OraBPELPM_1\integration\jdev\jdev\bin\jdev.conf
AddVMOption -Djavax.net.ssl.keyStore=E:\OraBPELPM_1\jdk\jre\lib\security\cacert
AddVMOption -Djavax.net.ssl.keyStorePassword=esbtest123
I am not able to create partner link using URL https://localhost/orabpel/default/ErrorHandlerBPEL/1.0/ErrorHandlerBPEL?wsdl .
Able to create partnerlink using same URL if I replace https with http.
Did I miss any other configuration that needs to done to create partnerlink using https in JDeveloper BPEL Designer.
Thanks,
-VidyaHi,
I too have the same issue. Appriciate if you share some knowledge on this issue.
Thanks
Aravinda -
Error while creating the ASSET using LSMW BAPI method ( BUS1022 )
Hello,
Im creating assets using the below LSMW BAPI method
Business Object BUS1022
Method CREATEINCLVALUES
Message Type FIXEDASSET_CREATEINCLVALU
Basic Type FIXEDASSET_CREATEINCLVALU
the following errors were triggered while populating the values to ACQ_VALUE and ORD_DEP value.
Correction to ordinary dep. greater than acc. dep. in area 01
Correction to ordinary dep. greater than acc. dep. in area 30
Correction to ordinary dep. greater than acc. dep. in area 31
Correction to ordinary dep. greater than acc. dep. in area 32
if i pass only ACQ_VALUE, I am able to create the asset with out any issues.
Can you guys plz guide me to fix this issue to create the asset with both ACQ_VALUE and ORD_DEP values??
Cheers,
Sriram.Hello,
Review AO21.
Regards
Waza -
Problem while creating logical port using soamanager
Hi all,
I have created a client proxy for web service from a 3rd party system.
When i am creating a logical port for the same consumer proxy i get a error as follows:
RABAX_STATE -e: UNCAUGHT_EXCEPTION
and a dump saying
" The exception 'CX_SXMLP' was raised, but it was not caught anywhere along the call hierarchy.
Since exceptions represent error situations and this error was not adequately responded to, the running ABAP program
'CL_SXMLP_FRAGMENT=============CP' has to be terminated.
Please suggest what can be done or what can be the problem.
Thanks in advance.
KomalPls go to txn SM59 and check if the RFC destination for webservice is working in the test connection.
Then go to txn LPCONFIG and create the logical port using the RFC dest. Pls mention the path suffix appropriately.
Next in your code while instantiating the client proxy pass the logical port name in the constructor (if the LP is not maintained as default).
Pls reward points if the tips are helpful. -
Problem while creating contact person using SD_CUSTOMER_MAINTAIN_ALL
Hi All,
I am trying to create a contact person to a customer using FM SD_CUSTOMER_MAINTAIN_ALL.Following is the simple code that I am using.FM is not giving any exception.But the contact person is not getting created.can anyone help me regarding this.
DATA: I_FKNVK TYPE TABLE OF FKNVK,
wa type FKNVK.
MOVE '0009011357' to wa-kunnr.
MOVE 'Bose' TO wa-namev.
MOVE 'Lalit' TO wa-name1.
MOVE '9980055557' to wa-TELF1.
*MOVE 'City' TO wa-ort01.
*MOVE 'DE' TO wa-parla.
*MOVE '' to watelf1.
*MOVE 'U' to wa-kz.
APPEND wa to I_FKNVK.
CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'
EXPORTING
I_KNA1 =
I_KNB1 =
I_KNVV =
I_BAPIADDR1 =
I_BAPIADDR2 =
I_MAINTAIN_ADDRESS_BY_KNA1 = ' '
I_KNB1_REFERENCE = ' '
I_FORCE_EXTERNAL_NUMBER_RANGE = ' '
I_NO_BANK_MASTER_UPDATE = ' '
I_CUSTOMER_IS_CONSUMER = ' '
I_RAISE_NO_BTE = ' '
PI_POSTFLAG = 'X'
PI_CAM_CHANGED = ' '
PI_ADD_ON_DATA =
I_FROM_CUSTOMERMASTER = ' '
IMPORTING
E_KUNNR =
O_KNA1 =
E_SD_CUST_1321_DONE =
TABLES
T_XKNAS =
T_XKNBK =
T_XKNB5 =
T_XKNEX =
T_XKNVA =
T_XKNVD =
T_XKNVI =
T_XKNVK = I_FKNVK
T_XKNVL =
T_XKNVP =
T_XKNZA =
T_YKNAS =
T_YKNBK =
T_YKNB5 =
T_YKNEX =
T_YKNVA =
T_YKNVD =
T_YKNVI =
T_YKNVK =
T_YKNVL =
T_YKNVP =
T_YKNZA =
T_UPD_TXT =
EXCEPTIONS
CLIENT_ERROR = 1
KNA1_INCOMPLETE = 2
KNB1_INCOMPLETE = 3
KNB5_INCOMPLETE = 4
KNVV_INCOMPLETE = 5
KUNNR_NOT_UNIQUE = 6
SALES_AREA_NOT_UNIQUE = 7
SALES_AREA_NOT_VALID = 8
INSERT_UPDATE_CONFLICT = 9
NUMBER_ASSIGNMENT_ERROR = 10
NUMBER_NOT_IN_RANGE = 11
NUMBER_RANGE_NOT_EXTERN = 12
NUMBER_RANGE_NOT_INTERN = 13
ACCOUNT_GROUP_NOT_VALID = 14
PARNR_INVALID = 15
BANK_ADDRESS_INVALID = 16
TAX_DATA_NOT_VALID = 17
NO_AUTHORITY = 18
COMPANY_CODE_NOT_UNIQUE = 19
DUNNING_DATA_NOT_VALID = 20
KNB1_REFERENCE_INVALID = 21
CAM_ERROR = 22
OTHERS = 23
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN =
ENDIF.i see this so much on this site, users just posting solved and not giving details on how they fixed the problem, the SDN is meant to be for sharing!!
If you find a fix, share it or don't bother being a part of the SDN community.(so annoying) -
Problem while creating sales order using BAPI
Hi all,
i am creating a sales order from the purchase order data.
when my client will send a PO in EDI format, my 3rd party edi tool will convert that edi formatted PO to text format. then i will upload that text formatted PO to my program then i will create a SO from those uploaded PO data using BAPI BAPI_SALESORDER_CREATEFROMDAT2.
but,no sales order is being created.& also i am not getting any return message.by debugging also, i am not getting the error.plz suggest where i am doing mistake.below is the coding.
DATA:
gfilename LIKE rlgrap-filename.
*--Internal tables
DATA: BEGIN OF i_item OCCURS 50. "Create Material Document Item
INCLUDE STRUCTURE BAPISDITM .
DATA: END OF i_item .
DATA: BEGIN OF i_partner OCCURS 20. "Return parameter
INCLUDE STRUCTURE BAPIPARNR.
DATA: END OF i_partner.
DATA: BEGIN OF i_schedule OCCURS 20. "Return parameter
INCLUDE STRUCTURE BAPISCHDL .
DATA: END OF i_schedule.
DATA: BEGIN OF i_cond OCCURS 20. "Return parameter
INCLUDE STRUCTURE BAPICOND .
DATA: END OF i_cond.
DATA: BEGIN OF i_part OCCURS 0, " Internal table for split data
part(20),
END OF i_part.
DATA: BEGIN OF i_return OCCURS 20. "Return parameter
INCLUDE STRUCTURE bapiret2.
DATA: END OF i_return.
*-- Work areas
DATA: BEGIN OF wa_header . "sales Document Header Data
INCLUDE STRUCTURE BAPISDHD1.
DATA: END OF wa_header .
*DATA: BEGIN OF wa_return . "Output Structure
INCLUDE STRUCTURE BAPIRET2.
*DATA: END OF wa_return .
DATA: begin of sorder.
INCLUDE STRUCTURE BAPIVBELN.
DATA: end of sorder.
data:begin of t_upload,
ebeln(10), "PO no(seagate)
aedat like sy-datum , "PO date
bsart(4) , "PO type
vdatu like sy-datum , "requested delivery date
kunnr(10) , "customer no-sold-to-party
kunak like vbak-kunnr, "bill-to-party
name1_s(20), "name1 of sold-to-party
name2_s(15), "name2 of sold-to-party
land1_s(3), "country
ort01_s(10), "city
regio_s(3), "region(state/province)
pstlz_s(10), "postal code
adrnr_s(10), "address
bstkd_e(10), "end customer purchase order
posex(6), "end customer PO line no(item no)
kdmat(18), "end customer material no(part no)
kunag(10), "ship-to-party
name1_c(20), "name1 of ship-to-party
name2_c(15), "name2 of ship-to-party
land1_c(3), "country
ort01_c(10), "city
regio_c(3), "region(state/province)
pstlz_c(10), "postal code
adrnr_c(10), "address
posnr(6), "item no(seagate PO line no)
pstyv(4), "item category
matnr(18), "material no(seagate 9 digit part no)
zmeng(13), "Target quantity in sales unit
vrkme like vbap-vrkme, "sales unit
meins(3), "UOM
posnr_tot like vbap-posnr,"Total no. of line items
werks(4), "plant
vstel like vbap-vstel, "shipping point
empst(10), "receiving point
shtyp(4), "shipment type
route(6), "route
vsbed(2), "shipping conds
rkfkf like vbap-rkfkf, "method of billing for co/ppc orders
zterm(4), "terms of payment key
inco1(3), "F.O.B inco term1
inco2(3), "F.O.B inco term2
end of t_upload.
Data: wa_upload like t_upload,
i_upload like standard table of t_upload.
Data:v_kunnr like kna1-kunnr,
v_posnr like vbap-posnr,
v_matnr like vbap-matnr,
v_zmeng like vbap-zmeng,
v_kunag like kna1-kunnr.
*---Constants
CONSTANTS: c_comma TYPE c VALUE ',', " For splitting data at commas
c_01(2) TYPE c VALUE '01', " For movement code in Bapi
c_b TYPE c VALUE 'B', " For mvt. Indicator in Bapi
c_creat(5) TYPE c VALUE 'CREAT', " For button text
c_clear(5) TYPE c VALUE 'CLEAR', " For clear button
c_mvmt(4) TYPE c VALUE 'MVMT',
c_ok(2) TYPE c VALUE 'OK',
c_error(5) TYPE c VALUE 'Error'.
*--SELECTION SCREEN DESIGN--
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
PARAMETERS:
p_auart LIKE vbak-auart, " order type
p_vkorg LIKE vbak-vkorg, " sales org
p_vtweg LIKE vbak-vtweg, " dist channel
p_spart LIKE vbak-spart, " division
p_vkgrp LIKE vbak-vkgrp, " sales group
p_vkbur LIKE vbak-vkbur, "sales office
p_file(256) default 'c:/saleorder.txt'. "File name
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN PUSHBUTTON 15(10) v_create USER-COMMAND creat.
SELECTION-SCREEN PUSHBUTTON 40(10) v_clear USER-COMMAND clear.
INITIALIZATION -
INITIALIZATION.
v_create = c_creat .
v_clear = c_clear.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM selectfile USING p_file.
*--AT SELECTION_SCREEN--
AT SELECTION-SCREEN .
IF sy-ucomm = c_clear.
PERFORM f_clear.
ELSE.
IF sy-ucomm <> c_mvmt.
**--- Validating the input data.
PERFORM f_check_inputs.
ELSEif sy-ucomm = c_creat.
*--- Validating the input data.
PERFORM f_check_inputs.
*-- Uploading the PO data.
PERFORM f_PO_upload.
*---checking the PO data
PERFORM f_check_upload_data.
*---create sales order from PO data
PERFORM f_Sales_order_create.
ENDIF.
FORM f_PO_upload.
gfilename = p_file.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = gfilename
filetype = 'DAT'
TABLES
data_tab = i_upload
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE i398(00) WITH '(WS_UPLOAD)'
' Errors occured with exception '
sy-subrc.
ENDIF.
ENDFORM. " f_PO_upload
*& Form selectfile
text
-->P_P_FILE text
FORM selectfile CHANGING value(filename) TYPE c.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = gfilename
def_path = 'C:\'
mask = ',*.txt.'
mode = 'O'
title = 'Select File Name'
IMPORTING
filename = filename
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
ENDFORM. " selectfile
FORM f_Sales_order_create.
PERFORM f_fill_header.
PERFORM f_fill_partner.
PERFORM f_fill_item.
PERFORM f_call_BAPI.
ENDFORM. " f_Sales_order_create
*& Form f_fill_header
text
--> p1 text
<-- p2 text
FORM f_fill_header.
move p_auart to wa_header-doc_type.
move p_vkorg to wa_header-sales_org.
move p_vtweg to wa_header-distr_chan.
move p_spart to wa_header-division.
move p_vkgrp to wa_header-sales_grp.
move p_vkbur to wa_header-sales_off.
Read table i_upload into wa_upload index 1.
move wa_upload-ebeln to wa_header-purch_no_c.
move wa_upload-aedat to wa_header-purch_date.
move wa_upload-bsart to wa_header-po_method.
move wa_upload-vdatu to wa_header-req_date_h.
move wa_upload-bstkd_e to wa_header-purch_no_s.
*move wa_upload-route to wa_header-route.
move wa_upload-vsbed to wa_header-ship_cond.
move wa_upload-empst to wa_header-rec_point.
move wa_upload-shtyp to wa_header-ship_type.
move wa_upload-zterm to wa_header-pmnttrms.
move wa_upload-inco1 to wa_header-incoterms1.
move wa_upload-inco2 to wa_header-incoterms2.
ENDFORM. " f_fill_header
*& Form f_fill_partner
text
--> p1 text
<-- p2 text
FORM f_fill_partner.
if not wa_upload-kunnr is initial.
select single kunnr from kna1 into v_kunnr
where kunnr = wa_upload-kunnr.
if sy-subrc <> 0.
Message E014 with 'customer does not exist'.
else.
move 'AG' to i_partner-partn_role.
move wa_upload-kunnr to i_partner-partn_numb.
move wa_upload-land1_s to i_partner-country.
move wa_upload-name1_s to i_partner-name.
move wa_upload-name2_s to i_partner-name_2.
move wa_upload-ort01_s to i_partner-city.
move wa_upload-regio_s to i_partner-region.
move wa_upload-pstlz_s to i_partner-postl_code.
move wa_upload-adrnr_s to i_partner-address.
append i_partner.
endif.
endif.
if not wa_upload-kunag is initial.
select single kunnr from kna1 into v_kunag
where kunnr = wa_upload-kunag.
if sy-subrc <> 0.
Message E015 with 'end customer does not exist'.
else.
move 'WE' to i_partner-partn_role.
move wa_upload-kunag to i_partner-partn_numb.
move wa_upload-land1_c to i_partner-country.
move wa_upload-name1_c to i_partner-name.
move wa_upload-name2_c to i_partner-name_2.
move wa_upload-ort01_c to i_partner-city.
move wa_upload-regio_c to i_partner-region.
move wa_upload-pstlz_c to i_partner-postl_code.
move wa_upload-adrnr_c to i_partner-address.
append i_partner.
endif.
endif.
ENDFORM. " f_fill_partner
*& Form f_fill_item
text
--> p1 text
<-- p2 text
FORM f_fill_item.
loop at i_upload into wa_upload.
if not wa_upload-matnr is initial.
select single maramatnr msegmenge into (v_matnr, v_zmeng) from
mara inner join mseg on maramatnr = msegmatnr
where mara~matnr = wa_upload-matnr.
if sy-subrc <> 0.
Message E016 with 'material no does not exist'.
elseif v_zmeng LT wa_upload-zmeng.
Message E017 with 'order quantity is greater than the quantity present'.
endif.
endif.
move wa_upload-posnr to i_item-itm_number.
move wa_upload-pstyv to i_item-item_categ.
move wa_upload-matnr to i_item-material.
move wa_upload-zmeng to i_item-target_qty.
move wa_upload-meins to i_item-target_qu.
move wa_upload-werks to i_item-plant.
*move wa_upload-meins to wa_vbap-meins.
*move wa_upload-posnr_tot to wa_vbap-posnr_tot.
move wa_upload-posex to i_item-po_itm_no.
move wa_upload-kdmat to i_item-cust_mat22.
move wa_upload-inco1 to i_item-incoterms1.
move wa_upload-inco2 to i_item-incoterms2.
move wa_upload-zterm to i_item-pmnttrms.
move wa_upload-empst to i_item-rec_point.
move wa_upload-shtyp to i_item-ship_type.
move wa_upload-route to i_item-route.
append i_item.
PERFORM f_fill_schedule_line.
PERFORM f_fill_conditions.
ENDLOOP.
ENDFORM. " f_fill_item
*& Form f_fill_schedule_line
text
--> p1 text
<-- p2 text
FORM f_fill_schedule_line.
move wa_upload-matnr to i_schedule-itm_number.
move sy-datum to i_schedule-req_date.
move wa_upload-zmeng to i_schedule-req_qty.
append i_schedule.
ENDFORM. " f_fill_schedule_line
*& Form f_fill_conditions
text
--> p1 text
<-- p2 text
FORM f_fill_conditions.
move wa_upload-matnr to i_cond-itm_number.
move sy-datum to i_cond-conpricdat.
append i_cond.
ENDFORM. " f_fill_conditions
*& Form f_clear
text
--> p1 text
<-- p2 text
FORM f_clear.
clear:p_auart,
p_vkorg,
p_vtweg,
p_spart,
p_vkgrp,
p_vkbur.
ENDFORM. " f_clear
*& Form f_call_BAPI
text
--> p1 text
<-- p2 text
FORM f_call_BAPI.
clear:i_item,i_partner,i_schedule.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
ORDER_HEADER_IN = wa_header
ORDER_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT = sorder
TABLES
RETURN =
ORDER_ITEMS_IN = i_item
ORDER_ITEMS_INX =
ORDER_PARTNERS = i_partner
ORDER_SCHEDULES_IN = i_schedule
ORDER_SCHEDULES_INX =
ORDER_CONDITIONS_IN = i_cond.
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
ORDER_CCARD =
ORDER_TEXT =
ORDER_KEYS =
EXTENSIONIN =
PARTNERADDRESSES =
if not ( sorder-vbeln is initial ).
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
write: /'Order number:', sorder.
else.
loop at i_return.
write: / i_return-id, i_return-number, i_return-message(80).
endloop.
*write: /'Error'.
endif.
*loop at i_return.
*write: / i_return-id, i_return-number, i_return-message(80).
*endloop.
ENDFORM. " f_call_BAPIHI
Pricing will be carried basing on the pricing
procedure.
Case1: Prices will be carried out automatically if
necessary condition records are maintained for the
condition type.
For this you can go to Sales Order-> Item Conditions
In the screen you can click on command button Analysis,
which gives you the list of condition types associated
to the pricing procedure. By clicking on the condition
type you can know the action that has taken place.
Case2: Manually forcing prices for Items.
To do this, you have to populate ORDER_CONDITIONS_IN &
ORDER_CONDITIONS_INX. Also note to identify the item
numbers, you manually pass the item number for each item
in the sales order, use the same item number for
populating conditions.
Parameters required:
ORDER_CONDITIONS_IN:
ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
ORDER_CONDITIONS_INX:
ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
Hope the above info helps you. Do revert back if you
need more info.
Kind Regards
Eswar -
Problem while creating table dynamically using stored procedure
Hi all
When i try to execute the following lines get insufficient privilege error.
FYI: i m able to create table statically.(i.e without using stored procedure)
CREATE OR REPLACE PROCEDURE pcalling IS
str varchar2(60);
BEGIN
str:='create table t15(tno number,tname varchar2(5))';
execute immediate str;
END;
Thanks in advance
Satyahi
SQL> CREATE OR REPLACE PROCEDURE runddl (ddl_in in VARCHAR2)
2 AUTHID CURRENT_USER
3 IS
4 BEGIN
5 EXECUTE IMMEDIATE ddl_in;
6 END;
7 .
SQL> /
Procedure created.AUTHID CURRENT_USER clause before the IS keyword which runddl executes, it should run under the authority of the invoker, or current user not the authority of the definer.
if you omit it then it will no longer will be run if the creator doesnt have privelege to run this ddl regardless invoker has or not.
i hope you got it
Khurram Siddiqui
[email protected]
Maybe you are looking for
-
Problems with PS Elements 11 on Maverick OS
Had to get a new computer. New Mac with Maverick OS. Installed my copy of PS Elements 11, but extract filter feature does not work.
-
Hi Guys I've invested in CS5 Master Collection, with AcrobatPro 9. I have a bunch of manuscript notes that I've scanned and keep on my laptop for business meetings. Will AcrobatPro 9 be able to convert manuscript into text, like one of the IRIS progr
-
Pdfs from illustrator in photoshop
whenever i open up a pdf i saved from illustrator in photoshop in appears all pixelated. but open it in acrobat or anythin else it opens up grand. these would be all vector based designs so should all be smooth n crisp. ant ideas on how to remedy thi
-
Visible property in ItemRenderer
Hi there, I have a very basic question. I'm trying to hide a canvas in the itemrender of a list <mx:List dataProvider="{currentCollection}" width="100%" height="100%"> <mx:itemRenderer> <mx:Component> <mx:Canvas visible="false" includeInLayo
-
Mail won't 'see' my existing messages
I have trouble with this everytime I have to migrate Mail data. My iMac's HD failed last week, and the external used for TimeMachine failed just days earlier - ugh! I have copied all Mail data into the Mail folder, and went through setup (allowed Mai