Strange Behavior of program while using BAPI_PO_CREATE1
Hello SAP GURUs,
I've created an Upload Program using BAPI_PO_CREATE1 for Mass Service PO Creation.
When I execute the program and Specify the File for uploading, It Gives me errors as
E BAPI 1 No instance of object type PurchaseOrder has been created. External reference:
E MEPO 0 Purchase order still contains faulty items
E 6 436 In case of account assignment, please enter acc. assignment data for item
But when I come back to Selection Screen of the Program and specify the SAME FILE AGAIN and Execute,
The Program runs successfully and generates the PO number.
I have never seen such strange behavior in any BAPIs before.
Pls help..
PERFORM refresh_tables.
PERFORM fill_tables.
END-OF-SELECTION.
Display the Summary as an ALV Grid Display
IF NOT ig_mymssg[] IS INITIAL.
PERFORM display_basic_list . "Grid Display
ELSE.
MESSAGE s000 WITH 'No data exists'(051).
STOP.
ENDIF.
*& Form refresh_tables
text
--> p1 text
<-- p2 text
FORM refresh_tables .
REFRESH: ig_fieldcat,
ig_mymssg,
poitem,
poitemx,
poaccount,
poaccountx,
poservices,
ig_return.
wt_itab, record, record2 .
ENDFORM. " refresh_tables
*& Form fill_tables
text
--> p1 text
<-- p2 text
FORM fill_tables .
record2[] = record[].
record3[] = record[].
DELETE ADJACENT DUPLICATES FROM record COMPARING id_no.
DELETE ADJACENT DUPLICATES FROM record2 COMPARING id_no po_item.
SELECT MAX( packno ) FROM esll INTO wrk_packno.
LOOP AT record.
CLEAR : poheader, poheaderx, wa_poitem, wa_poitemx, wa_poservices, wa_poaccount, wa_poaccountx, wa_poschedulex, wa_poschedule.
REFRESH: poitem, poitemx, poaccount, poaccountx, poservices, ig_return, posrvaccessvalues, poschedule, poschedulex.
PERFORM po_header.
LOOP AT record2 WHERE id_no = record-id_no.
wrk_packno = wrk_packno + 1.
PERFORM po_item.
PERFORM po_scheudle.
PERFORM acc_assignment.
PERFORM po_services.
ENDLOOP.
PERFORM create_po.
ENDLOOP.
ENDFORM. " fill_tables
*& Form display_basic_list
text
--> p1 text
<-- p2 text
FORM display_basic_list .
g_repid = sy-repid.
PERFORM f2000_fieldcat_init .
PERFORM display_alv_grid_1.
ENDFORM. " display_basic_list
*& Form f2000_fieldcat_init
text
--> p1 text
<-- p2 text
FORM f2000_fieldcat_init .
REFRESH ig_fieldcat.
PERFORM fill_fields_of_fieldcatalog USING 'IG_MYMSSG'
'STATUS'
c_x
'Status'
'10'.
PERFORM fill_fields_of_fieldcatalog USING 'IG_MYMSSG'
'RECORD'
c_x
'Record'
'20'.
PERFORM fill_fields_of_fieldcatalog USING 'IG_MYMSSG'
'ERRMSG'
'Message'
'100'.
ENDFORM. " f2000_fieldcat_init
*& Form display_alv_grid_1
text
--> p1 text
<-- p2 text
FORM display_alv_grid_1 .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_structure_name = 'IG_MYMSSG'
i_grid_title = 'LOG'
is_layout = wg_layout
it_fieldcat = ig_fieldcat[]
i_save = c_save
TABLES
t_outtab = ig_mymssg
EXCEPTIONS
program_error = 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. " display_alv_grid_1
*& Form fill_fields_of_fieldcatalog
text
-->P_0626 text
-->P_0627 text
-->P_C_X text
-->P_0629 text
-->P_0630 text
FORM fill_fields_of_fieldcatalog USING p_tabname TYPE slis_tabname
p_field TYPE slis_fieldname
p_key TYPE c
p_name
len.
To fill in the fields of the table fieldcatalog depending on the field
CLEAR wg_fieldcat.
wg_fieldcat-fieldname = p_field. " The field name and the table
wg_fieldcat-tabname = p_tabname.. " name are the two minimum req
wg_fieldcat-key = p_key. " Specifies the column as a key
wg_fieldcat-seltext_l = p_name. " Column Header
wg_fieldcat-outputlen = len.
APPEND wg_fieldcat TO ig_fieldcat.
ENDFORM. " fill_fields_of_fieldcatalog
*& Form create_po
text
--> p1 text
<-- p2 text
FORM create_po .
CLEAR : wg_return.
REFRESH : ig_return.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = poheader
poheaderx = poheaderx
IMPORTING
exppurchaseorder = po_no
TABLES
return = ig_return
poitem = poitem
poitemx = poitemx
poschedule = poschedule
poschedulex = poschedulex
poaccount = poaccount
poaccountx = poaccountx
poservices = poservices
posrvaccessvalues = posrvaccessvalues.
SORT ig_return BY type.
READ TABLE ig_return INTO wg_return WITH KEY type = 'S'.
IF sy-subrc EQ 0.
CLEAR : wg_return.
REFRESH : ig_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
CLEAR wg_errmsg.
WRITE icon_green_light AS ICON TO wg_errmsg-status.
CONCATENATE record-id_no po_no INTO wg_errmsg-record SEPARATED BY '/'.
wg_errmsg-record = po_no.
wg_errmsg-errmsg = 'PO created'.
APPEND wg_errmsg TO ig_mymssg.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
READ TABLE ig_return INTO wg_return WITH KEY type = 'E' TRANSPORTING message.
CLEAR wg_errmsg.
WRITE icon_red_light AS ICON TO wg_errmsg-status.
wg_errmsg-record = record-id_no.
wg_errmsg-errmsg = wg_return-message.
APPEND wg_errmsg TO ig_mymssg.
ENDIF.
ENDFORM. " create_po
*& Form po_header
text
--> p1 text
<-- p2 text
FORM po_header .
poheader-comp_code = record-comp_code.
poheader-doc_type = record-doc_type.
poheader-vendor = record-vendor.
poheader-purch_org = 'SERV'.
poheader-pur_group = record-pur_group.
poheader-currency = 'INR'.
poheaderx-comp_code = 'X'.
poheaderx-doc_type = 'X'.
poheaderx-vendor = 'X'.
poheaderx-purch_org = 'X'.
poheaderx-pur_group = 'X'.
poheaderx-currency = 'X'.
ENDFORM. " po_header
*& Form po_item
text
--> p1 text
<-- p2 text
FORM po_item .
DATA : days TYPE num2.
DATA : final_dt TYPE datum.
DATA : is_ok TYPE boole_d.
DATA : msg_hndlr TYPE REF TO if_hrpa_message_handler.
days = 20.
CALL FUNCTION 'HR_ECM_ADD_PERIOD_TO_DATE'
EXPORTING
orig_date = sy-datum
num_days = days
signum = '+'
message_handler = msg_hndlr
IMPORTING
result_date = final_dt
is_ok = is_ok.
CLEAR: wa_poitem,wa_poitemx.
wa_poitem-po_item = record2-po_item.
wa_poitem-short_text = record2-short_text.
wa_poitem-plant = record2-plant.
wa_poitem-matl_group = 'S001'.
wa_poitem-tax_code = 'LA'.
wa_poitem-item_cat = item_cat.
wa_poitem-pckg_no = wrk_packno.
wa_poitem-acctasscat = acctasscat.
wa_poitem-gr_to_date = final_dt.
APPEND wa_poitem TO poitem.
wa_poitemx-po_item = record2-po_item.
wa_poitemx-po_itemx = 'X'.
wa_poitemx-short_text = 'X'.
wa_poitemx-plant = 'X'.
wa_poitemx-tax_code = 'X'.
wa_poitemx-item_cat = 'X'.
wa_poitemx-acctasscat = 'X'.
wa_poitemx-pckg_no = 'X'.
wa_poitemx-matl_group = 'X'.
wa_poitem-gr_to_date = 'X'.
APPEND wa_poitemx TO poitemx.
ENDFORM. " po_item
*& Form PO_SERVICES
text
--> p1 text
<-- p2 text
FORM po_services .
CLEAR: wa_poservices, wa_posrvaccessvalues.
wa_poservices-pckg_no = wrk_packno.
wa_poservices-line_no = '0000000001'.
wa_poservices-outl_ind = 'X'.
wa_poservices-subpckg_no = wa_poservices-pckg_no + 1.
wa_poservices-from_line = '000001'.
APPEND wa_poservices TO poservices.
CLEAR wa_poservices.
wrk_packno = wrk_packno + 1.
wa_poservices-pckg_no = wrk_packno.
wa_poservices-line_no = '0000000002'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = record2-service
IMPORTING
output = record2-service.
wa_poservices-ext_line = '0000000010'.
wa_poservices-service = record2-service.
wa_poservices-quantity = record2-quantity.
wa_poservices-gr_price = record2-gr_price.
wa_posrvaccessvalues-pckg_no = wrk_packno.
wa_posrvaccessvalues-line_no = '0000000002'.
wa_posrvaccessvalues-serial_no = '01'.
wa_posrvaccessvalues-serno_line = '01'.
wa_posrvaccessvalues-quantity = record2-quantity.
wa_posrvaccessvalues-net_value = record2-gr_price.
APPEND wa_poservices TO poservices.
APPEND wa_posrvaccessvalues TO posrvaccessvalues.
ENDFORM. " PO_SERVICES
*& Form ACC_ASSIGNMENT
text
--> p1 text
<-- p2 text
FORM acc_assignment .
DATA : tmp_gl LIKE bapimepoaccount-gl_account.
tmp_gl = '400265'.
CLEAR : wa_poaccount, wa_poaccountx.
wa_poaccount-po_item = record2-po_item.
wa_poaccount-serial_no = '01'.
wa_poaccount-co_area = '1000'.
wa_poaccount-quantity = record2-quantity.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = tmp_gl
IMPORTING
output = wa_poaccount-gl_account.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = record2-orderid
IMPORTING
output = wa_poaccount-orderid.
APPEND wa_poaccount TO poaccount.
wa_poaccountx-po_item = record2-po_item.
wa_poaccountx-serial_no = '01'.
wa_poaccountx-co_area = 'X'.
wa_poaccountx-quantity = 'X'.
wa_poaccountx-gl_account = 'X'.
wa_poaccountx-orderid = 'X'.
APPEND wa_poaccountx TO poaccountx.
ENDFORM. " ACC_ASSIGNMENT
*& Form PO_SCHEUDLE
text
--> p1 text
<-- p2 text
FORM po_scheudle .
CLEAR : wa_poschedule, wa_poschedulex.
wa_poschedule-po_item = record2-po_item.
wa_poschedule-sched_line = '0001'.
wa_poschedule-del_datcat_ext = 'D'.
wa_poschedule-delivery_date = sy-datum.
wa_poschedule-quantity = record2-quantity.
APPEND wa_poschedule TO poschedule.
wa_poschedulex-po_item = record2-po_item.
wa_poschedulex-sched_line = '0001'.
wa_poschedulex-po_itemx = 'X'.
wa_poschedulex-sched_linex = 'X'.
wa_poschedulex-del_datcat_ext = 'X'
wa_poschedulex-delivery_date = 'X'.
wa_poschedulex-quantity = 'X'.
APPEND wa_poschedulex TO poschedulex.
ENDFORM. " PO_SCHEUDLE
Similar Messages
-
Short dump while using BAPI_PO_CREATE1
Hi all,
I am facing this short dump while executing my program that uses BAPI_PO_CREATE1.
The error is 'Exception condition "failure" raised'.
The trigger location of runtime error is
Program : CL_HANDLE_MANAGER_MM====================CP
Include: CL_HANDLE_MANAGER_MM=====================CM005
Module name: GET
Source code:
Method GET.
If my_manager is initial.
Call method get_manager.
endif.
call method my_manager-> search EXporting im_id = im_id
Importing ex_handle = ex_handle
Exceptions failure = 01.
If sy-subrc <>0.
raise failure.
endif.
I am a beginner in ABAP. Plz help.Hi ,
I faced the similar situation once , in my case when i passed the Delivery indicator value in the Item Table as well as Itemx Table , i was facing this error .
what i suggest you is to pass it at the Item table only , not at the itemx Table.
it worked for me .
try this and reply for the same. -
Net Price showing zero while using BAPI_PO_CREATE1 for me21n
Dear All,
I am using BAPI_PO_CREATE1 for ME21N. The problem is, after execution of the program the error msg it shows-
No instance of object type PurchaseOrder has been created. External reference:
Purchase order still contains faulty items
Net price must be greater than 0
The values are coming from excel file.
Please tell me where I am doing wrong.
With regards,
Rosaline.Hi,
Symptom
You create a purchase order with BAPI_PO_CREATE1 or you add an item to an existing purchase order with BAPI_PO_CHANGE. You assign a value in field POITEM-NET_PRICE. However, this value is not transferred. If it was not possible for you to determine any conditions, the system generated the error message 06218 'Net price must be greater than 0'.
Other terms
BAPI_PO_CREATE1, BAPI_PO_CHANGE, price, net price, gross price, conditions, price determination, condition type, 06218, EKPO-NETPR, NETPR, POITEM-NET_PRICE, NET_PRICE, PO_PRICE, BAPI_PO_PRICE, BUS2012, PurchaseOrder.CreateFromData1, CreateFromData1, PurchaeOrder.Change
Reason and Prerequisites
This function has not been available up to now. You could also assign conditions via the condition tables.
Read also Notes 399791, 428621, 529287, 578253 and 539950 for this.
Solution
The present note adds field PO_PRICE to table POITEM. PO_PRICE can have the values ' ', '1' or '2' with the following meaning:
PO_PRICE = ' ': The price determination is carried out as before.
PO_PRICE = '1': The value assigned in field NET_PRICE is transferred as a gross price, that is it is set in the condition type that is defined as a base price in the calculation schema. All other condition types remain unchanged. No conditions are copied from the last document.
PO_PRICE = '2': The value assigned in field NET_PRICE is transferred as a net price, that is it is set in the condition type that is defined as base price in the calculation scheme. All other condition types are deleted.
Note the following
The following restrictions apply to field PO_PRICE:
If you assign conditions via the BAPI interface, these are always transferred. This is carried out independently of the value that you assign in field PO_PRICE.
If you add a new item to a purchase order with BAPI_PO_CHANGE, it does not suffice to fill field POITEM-NET_PRICE on item level. The corresponding currency must be specified explicitly on header level.
You can only use field PO_PRICE during the creation of a purchase order item. If you want to change the price of an already existing item, you can only do this via the conditions.
If you fill field POITEM-PO_PRICE, you must enter an 'X' in POITEMX-PO_PRICE so that the value is transferred.
Correction
The correction is made available via R/3 support package. If you want to implement the note manually, proceed as follows:
1. Make sure that your system contains Notes 494759, 552189 and 578253.
2. Create data type BAPI_PO_PRICE with the following attributes:
Short text:
Price transfer indicator: 1 = gross, 2 = net
Package: ME
Domain: BPUEB
3. Extend structure BAPIMEPOITEM (directly after NO_ROUNDING):
Component: PO_PRICE
Component type: BAPI_PO_PRICE
4. Extend structure BAPIMEPOITEMX (directly after NO_ROUNDING):
Component: PO_PRICE
Component type: BAPIUPDATE
5. Extend structure MEPOITEM_DATA (directly after NO_ROUNDING):
Component: PO_PRICE
Component type: BAPI_PO_PRICE
6. Extend structure MEPOITEM_DATAX (directly after NO_ROUNDING):
Component: PO_PRICE
Component type: BAPIUPDATE
7. Implement the correction instructions in your system.
regards,
Ravi
Edited by: Parupelly on Dec 14, 2011 1:30 PM -
Error: Internal Prising Error while using BAPI_PO_CREATE1
Hi Experts,
I am creating PO from Contract (VA41/VA42) using BAPI_PO_CREATE1 in user exit MV45AFZZ - USEREXIT_SAVE_DOCUMENT_PREPARE.
BAPI is returning the PO number and after coming out from BAPI. I am getting an popup message STOP - Internal Prising Error.
Even though bapi returned the PO number there is no PO exists with that number.
Please provide you valuable inputs.
Thanks & RegardsHi Experts,
I am creating PO from Contract (VA41/VA42) using BAPI_PO_CREATE1 in user exit MV45AFZZ - USEREXIT_SAVE_DOCUMENT_PREPARE.
BAPI is returning the PO number and after coming out from BAPI. I am getting an popup message STOP - Internal Prising Error.
Even though bapi returned the PO number there is no PO exists with that number.
Please provide you valuable inputs.
Thanks & Regards -
Problem in Conditions while using BAPI_PO_CREATE1
Hi All
I am using BAPI_PO_CREATE1 to create purchase Order. When I am changing calculation type for condition type's system not picking the correct amount through BAPI.
For e.g. for condition type 'FRB1' (Freight Value) I have maintain the amount 10.00 in condition value for calculation type 'B' (fixed amount). But when I pass calculation type 'A' i.e. Percentage, BAPI overwrites the amount to 1.00%.
I Want to pass the amount 10.00 as it is with calculation type '%'. Kindly suggest how to do it.
Regards,
PradipHi All
I am using BAPI_PO_CREATE1 to create purchase Order. When I am changing calculation type for condition type's system not picking the correct amount through BAPI.
For e.g. for condition type 'FRB1' (Freight Value) I have maintain the amount 10.00 in condition value for calculation type 'B' (fixed amount). But when I pass calculation type 'A' i.e. Percentage, BAPI overwrites the amount to 1.00%.
I Want to pass the amount 10.00 as it is with calculation type '%'. Kindly suggest how to do it.
Regards,
Pradip -
Parallel ABAP programming while using references
Hi SCN,
first of all the context of my problem, to get to its root:
I have created a kind of Framework (object oriented), which later on will provide an easy way to set up Charts in a Dashboard.
Put simply, the framework works like this:
There is a interface for the source of the data and customizing to be shown in the chart, with the methods 'get_data' and 'get_customizing'.
You can simply implement the specific interface in a class, which therefore is a 'source object' for the chart classes later on (getting the Chart Customizing and the Chart data using the defined methods mentioned above). The chart classes use the functionality of CL_GUI_CHART_ENGINE.
This concept works fine so far.
But I added a quite important feature - every chart should be refreshed after some time. Therefore I use the class CL_GUI_TIMER, which triggers the refreshing after some time. The problem is: if there are for instance two graphs shown and the first one is refreshing it's data (so the 'get_data' method of the source object is processed, which could mean there are some select statements implemented and therefore need some time). WHILE this is processing, the time may has come for the second graph to refresh (so CL_GUI_TIMER raises the 'finished' event) - so the event will be fired, but the handler method for the won't be executed, because the first chart is currently processing the GET_DATA method. This means, nothing happens when the second chart should be refreshed.
Fine, I told myself, parallel programming could easily fix this (later on, I figured out I was horribly mistaken (comment: I had no experience in parallel programming in ABAP so far)).
My intention was to give every chart object a separate 'thread', so they wouldn't be in each others ways (and thereby, as a side effect, the whole construct would gain some performance).
Finally we got to the actual problem:
There my problems started - the only way, to do some parallel programming in ABAP seems to be function modules using RFC (event though I always want to stay on the same application server). So the 'parallel thread' has to be a RFC function module - which means, there is no possibility for me to supply some object references to the function module (in my example, this would be the graph objects). So far I tried to do some workarounds like:
- using serialization, whereby I give the serialized objects into the function module as a string and rebuild it in there, which would work fine, if there where no attributes of objects, that are not serialize-able, in the chart objects (like a instance of CL_GUI_TIMER and some more).
- using shared objects, which gives me a way to access the object from the function module as well. But - there is no way to use event-handler methods in shared objects classes. So if I mark the 'Root class' of the chart classes as shared memory-enabled in SE24, I can't activate it, because it contains some event-handler methods (for example the one that reacts on the 'finished' event of CL_GUI_TIMER).
Now I'm running out of ideas, how I could solve my problems and use parallel programming in ABAP actually using references and all the object oriented features I need (events, interfaces, inheriting and so on).
Does someone of you out there have any idea how I could fix this - if there may is another way of parallel programming in ABAP, or another way to access objects using RFC function modules, or anything else?
I really appreciate any hint you could give me.
Let me know, if you need some more information.
Thank you very very much for your help and best regards
SebastianAs you said RFC Enabled function modules are the only way to enable parallel processing.
Your event handler for the 'finished' event of your timer can call an RFC FM with another method on the class being performed when it's done:
CALL FUNCTION func STARTING NEW TASK task
[DESTINATION {dest|{IN GROUP {group|DEFAULT}}}]
parameter list
CALLING meth ON END OF TASK].
You can pass in what you need for the select and get back the results. Then the method you call 'on end of task' can perform the rest of the refresh. If you want to stick to mostly OO concepts then the RFC function module could just be a wrapper for a static method on your class which gathers data for your refresh... -
Exception "Cannot run program" while using ProcessBuilder class
Hi Java-Folks,
I try to start a program within a Java application using the ProcessBuilder class. This is the first time I use ProcessBuilder so I do not have any deep knowledge of it. Here is a snippet of my code:
static void connectToHost(String Host) {
ProcessBuilder pb = new ProcessBuilder("connect.exe"), Host);
Map<String, String> env = pb.environment();
env.put("SHELLWIDTH", "64");
pb.directory(new File("C:\\MyProgram\\ExApp\\shell"));
try (
Process p = pb.start();
} catch (IOException ex) {
Logger.getLogger(ShellUtil.class.getName()).log(Level.SEVERE, null, ex);
}Using this method I get an IOException which says *"Cannot run program "connect.exe" (in directory "C:\MyProgram\ExApp\shell"): CreateProcess error=2, The system couldn't find the specified file"*
Does anybody have an idea why this is not working? I tried to start another application like "notepad.exe" and that works fine. So it seems related to the fact
that the program I want to start is only available in a certain directory and not via the PATH env-variable.
I would appreciate any help or hint :-)
Regards,
LemmyOkay I guess I misinterpreted the JavaDocs regarding the directory method. The exception message is a little bit confusing too, because it seems like Java tries to find the Application within the specified
working directory.
I tried to use the full path with the ProcessBuilder constructor and it looks like this variant is working. I still have some trouble with the application itself but I was able to start another program which is
not in the PATH var, using the full path to the executable.
Thanks for the help so far.
Bye
Lemmy -
Strange shade of plank while using compton inside openbox
Click to View ScreenShot
As the image indicates. There is a strange shade at the bottom of the screen. Is there anyway to get ride of it?
Info:
plank-bzr(aur)
openbox
compton-git(aur)
My compton options:
compton -m 0.7 -e 0.7 -c -f &
Last edited by jilen (2013-09-14 14:57:49)ooo wrote:
you could try adding -C (Avoid drawing shadows on dock/panel windows) in your compton command.
I'm pretty sure that should work since I've used docky myself without getting the shadow beneath it.
if not, there's also a --shadow-exclude option
It just works perfectly , Thansk guy!!!!! -
Error while using threads in proc program
Hi,
I am getting the error fetched column value NULL (-1405) in proc program while using the threads.
The execution of the program is as follows.
Tot_Threads = 5 (Total threads, totally 5 records with value instance names)
No_Of_threads = 1 (No Of threads executed at the same time)
Example :
INSTANCE_NAME Link1, link2, link3, link4, link5 (All different Databases)
NO_OF_THREADS - 5
Threading Logic:
Based on the maintanence NO_OF_THREADS, the program will process.
If (NO_OF_THREADS == 0)
Process_Sequence
else
if NO_OF_THREADS == TOT_THREADS
Process_Type1
else
Process_Type2
In a loop for all different instances,
New context area will be created and allocated.
New oracle session will be created.
New structure will be created and all global parameters are assigned to that structure.
For each instance, a new thread will be created (thr_create) and all the threads will call
the same(MainProcess) function which takes the structure as parameter.
At the end of every session, the corresponding oracle session will logged out.
Process_Type1 logic :
/* For Loop for all threads in a loop */
for(Cnt=0;Cnt < Tot_Threads;Cnt++)
/* Allocating new contect for every different thread */
EXEC SQL CONTEXT ALLOCATE :ctx[Cnt];
/* Connected to new oracle session */
logon(ctx[Cnt],ConnStr);
/* Assigning all the global parameters to the structure and then passing it to InsertBatching function */
DataSet[Cnt].THINDEX=Cnt;
DataSet[Cnt].sDebug=DebugMode;
strcpy(DataSet[Cnt].THNAME,(char *)InsNameArr[Cnt].arr);
DataSet[Cnt].ctx=ctx[Cnt];
/* creating new threads for time in a loop */
RetVal = thr_create(NULL,0,InsertBatching,&DataSet[Cnt],THR_BOUND,&threads[Cnt]);
sprintf(LocalStr1,"\nCreated thread %d", Cnt);
DebugMessage(mptr,LocalStr1,DebugMode);
for(Cnt=0;Cnt <Tot_Threads;Cnt++)
/* Waiting for threads to complete */
if (thr_join(threads[Cnt],NULL,NULL))
printf("\nError in thread Finish \n");
exit(-1);
/* Logout from the specific oracle session */
logoff(ctx[Cnt]);
/* Free the context area after usage */
EXEC SQL CONTEXT FREE :ctx[Cnt];
used functions:
thr_create with thr_suspend option
thr_join to wait for the thread to complete
Process_Type2 logic :
Here the idea is , if the load is heavy , then we can change the maintanence of NO_OF_THREADS (Ex - 2), so that only two threads will be executed in the same time , others should wait for the same to complete ,once the first two threads completed and the next two should be started and then in the same manner it will do for all the threads.
The parameters passing and the structure passing are same as above.
Here all threads will be created in suspended mode, and then only No_Of_threads(2) will
be started, others will be in suspended mode, once the first two is completed then the
other two thread will be started and in the same manner other threads.
used functions:
thr_create with thr_suspend option
thr_continue to start the suspended thread
thr_join to wait for the thread to complete
Process_Sequence logic :
Here the idea is , to run the program for all the instances , without creating the threads.Hence in the for loop , one by one instance will be taken and call the same function to Process. This will call the same function repeated for each different value. The parameters passing and the structure passing are same as above.
The InsertBatching function will prepare the cursor and pick all records for batching and then , it will call other individual functions for processing. For all the functions the structure variable will be passed as parameter which holds all the neccessary values.
Here in all the sub functions , we have used
EXEC SQL CONTEXT USE :Var;
Var is corresponding context allocated for that thread, which we assume that the corresponding context is used in all sub functions.
EXEC SQL INCLUDE SQLCA;
This statement we have given in InsertBatching Function not in all sub functiosn
Example for the Sub functions used in the program :-
/* File pointer fptr and dptr are general file pointers , to write the debub messages, DataStruct will hold all global parameters and also context area .
int Insert(FILE fptr,FILE dptr,DataStruct d1)
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR InsertStmt[5000];
EXEC SQL END DECLARE SECTION;
char LocalStr[2000];
EXEC SQL CONTEXT USE :d1.ctx;
InsertStmt will hold insert statement
EXEC SQL EXECUTE IMMEDIATE :InsertStmt;
if (ERROR)
sprintf(LocalStr,"\nError in Inserting Table - %s",d1.THNAME);
DebugMessage(dptr,LocalStr,d1.sDebug);
sprintf(LocalStr,"\n %d - %s - %s",sqlca.sqlcode,ERROR_MESG,d1.THNAME);
DebugMessage(dptr,LocalStr,d1.sDebug);
return 1;
return 0;
I get this error occationally and not always. While preparing the sql statement also i am getting this error.
The code contains calls to some stored procedures also.
Thanks in advancein every select nvl is handled and this error is occuring while preparing statements also
-
Strange behavior with Zoom and Image control
HELP - I have a strange behavior (bug?) with using Zoom
effect on an Image that has been placed on a Canvas. I am using
dynamically instantiated images which are placed on a canvas inside
a panel. I then assign a Zoom IN and Zoom Out behavior to the
image, triggered by ROLL_OVER and ROLL_OUT effect triggers. THE BUG
is that the image jumps around on the Zoom OUT and lands on a
random place on the canvas instead of coming back to the original
spot. This is especially true if the mouse goes in and out of the
image very quickly. HELP -- what am I doing wrong? Computer = Mac
OS X 10.4.9 Flex 2.0.1
Here's a simple demo of the bug -- be sure to move the mouse
in and out rapidly:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="setUp();">
<mx:Script><![CDATA[
import mx.events.EffectEvent;
import mx.effects.Fade;
import mx.effects.Zoom;
import mx.rpc.events.ResultEvent;
import flash.display.Sprite;
import mx.core.UIComponent;
import mx.controls.Image;
private var zoomIn:Zoom;
private var zoomOut:Zoom;
private function setUp():void {
var image:Image = new Image();
image.id = "album_1_1";
image.x = 200;
image.y = 200;
image.width = 64;
image.height = 64;
image.source = "
http://s3.amazonaws.com/davidmccallie/album-128.jpg";
image.addEventListener(MouseEvent.ROLL_OVER, doZoom);
image.addEventListener(MouseEvent.ROLL_OUT, doZoom);
myCanvas.addChild(image);
zoomIn = new Zoom();
zoomIn.zoomHeightTo = 2.0;
zoomIn.zoomWidthTo = 2.0;
zoomIn.captureRollEvents = true;
zoomIn.suspendBackgroundProcessing = true;
zoomOut = new Zoom();
zoomOut.zoomHeightTo = 1.0;
zoomOut.zoomWidthTo = 1.0;
zoomOut.captureRollEvents = true;
zoomOut.suspendBackgroundProcessing = true;
private function doZoom(event:MouseEvent):void {
var image:Image = Image(event.currentTarget);
if (event.type == MouseEvent.ROLL_OVER) {
zoomIn.target = event.currentTarget;
zoomIn.play();
} else if (event.type == MouseEvent.ROLL_OUT) {
zoomOut.target = event.currentTarget;
zoomOut.play();
]]>
</mx:Script>
<mx:Panel width="100%" height="100%"
layout="absolute">
<mx:Canvas id="myCanvas" width="100%" height="100%">
</mx:Canvas>
</mx:Panel>
</mx:Application>There must be bugs in the Zoom effect code -- I changed the
Zoom to Resize in the above code, and it works perfectly. Of
course, Resize is not as nice as Zoom because you can't set the
resize to be around the center of the image, but at least it works.
Does anyone know about bugs in the Zoom effect? -
Strange Behavior of af:inputListOfValues
Hi,
I've tried the demo for How-to build Oracle Forms style List-of-Values in ADF Faces RC at [http://www.oracle.com/technology/products/jdev/tips/fnimphius/lov/listOfValues.html|http://www.oracle.com/technology/products/jdev/tips/fnimphius/lov/listOfValues.html] .
As it's shown in the example if you enter SA_ the JobId field in the LOV is filled with SA_%.
Yes this happens only the first time you enter a value. After the first time, the result is a blank field.
Does anybody know how to solve this strange behavior?
I'm using JDeveloper 11g build 5188.
Regards,
JavaDeVeLoperHi,
I see this too. However, the source code works and it seems to be a refresh issue with the applied criteria
Frank -
Hi,
After moving from Win8 to Win8.1 (using WindowsStore update),
I observed sometimes that some command prompt Windows (ugly black MSDOS Windows) opens / closes Repetitively in my desktop.
At a moment where the computer was really busy, I was abble to see the title of this black window :
It was : C:\Program Files\Microsoft\OnlineManagement\Updates\Bin\omupdclt.exe
Can someone tell me how to prevent this strange behavior ?
Thanks in advance.
AC Soft.I have also openned a case at WindowsIntune support, and up to now, they replyed me this :
We have been able to reproduce this issue ourselves. We are currently working with our engineers to identify if there is a way to prevent these command prompts from launching.
So, while waiting, I Tried your solution.
On the Win8.1 computer that had the problem, i found an AccoundID value, with { }, and all letters in Uppercase, as described in your solution. So, the problem for me is not that AccountID is not populated...
When I looked at another Win8.1 computer that had not the problem, i found an AccountID value
without { }, and with all letters
in lowercase.
So I looked at a Win7 Virtual machine that was enroled into intune too, and that obviously didn't had the problem, and I found there an AccountID value without { }, and with all letters in lowercase, same as on the working computer.
So on the computer that had the problem, I removed the { }, put all letters in lowercase, then run
%ProgramFiles%\Microsoft\OnlineManagement\Updates\Bin\omupdclt.exe /agentupdatenow
I rebooted the computer, and now, I wait to see if the problem is solved...
I will tell you what happened in some days...
AC Soft.
That process will not fix this issue. We have a fix coming in an upcoming service release.
Thanks,
Jon L. - MSFT - This posting is provided "AS IS" with no warranties and confers no rights. -
Strange behavior after using NIK plug-ins
Every once in a while I encounter this strange behavior of Aperture. I first process the NEF's in Aperture (white balance, Exposure, Enhance... and, when needed, Cropping) and then I fine tune the image with the NIK plug-ins; when needed DfIne 2.0, Viveza, Color Efex Pro 3.0 and Sharpener Pro 3.0 Output Sharpener.
If I look at the processed picture then, I get a perfect presentation of the photo;
!http://users.skynet.be/fc419085/Aperture-1.jpg!
But when I press Z to zoom into a 100% preview I get this;
!http://users.skynet.be/fc419085/Aperture-2.jpg!
When I select the Loup in the normal view mode I get this;
!http://users.skynet.be/fc419085/Aperture-3.jpg!
This doesn't happen with all my pictures, yesterday I processed a series of 8 pictures an 6 of them showed this behavior the other two acted normal and I can't see what I did differently whit these last two.
When I export the strangely behaving photo's to a Tiff or a Jpeg, I get perfectly normal pictures.
The original NEF behaves normal. I have seen this behavior with NEF's from a Nikon D200, D2x and a D300. I have Aperture 2.1.2 running on a 2.33 GHz Intel Core Duo MacBook Pro running Mac OS X 10.5.6
Does anybody know what's happening and if so, how to solve this problem?
Cheers,
IvanI did some testing and what I found is too weird to be true.
First this mashed up look doesn't only happen after using NIK plug-ins, it also happens when making a roundtrip to Photoshop, given that certain conditions are met.
Give it a try yourself. Crop an image to an uneven pixelcount dimension, for example 4227 x 2797 and make a roundtrip to Photoshop. Then have a 100% view look at the new image in Aperture. You'll have a mashed up view, at least I do.
Now crop the same original image to an even pixelcount dimension, for example 4228 x 2798 and make an roundtrip to Photoshop once more. When you have a 100% view of the new image now, you'll see a perfectly normal photo.
Do you think Aperture developers are reading this forum? -
Strange behavior while plugged in
Hi,
my X1 compact shows a strange behavior since yesterday:
I plugged it in via the USB port for charging, and it started doing crazy things. Screen brightness went flashing from low to high and back, the touchscreen showed slow or no response to pushing buttons, everything got laggy as if some kind of process was running in the background with no end. When I unplug it, it basically works normally. But - from this time on, I couldn't charge it anymore, as the charge went down instead of up when plugged in! I tried a factory reset several times (power + volume up for 3 seconds), and although it did reset, the charging problem remained. I left it turned off for one night while plugged in, and in the morning, it was just charged to 25% with the charge going down rapidly in the first couple of minutes (after 5 minutes to 11%). Now it's at 1%, but I can use it for quite a while, indicating that the displayed charge certainly isn't correct.
When I plug it in, the same things happen again and again. When plugged in, I can't even enter the PIN correctly, because touchscreen input is somehow recognized falsely.
What could that be, what could I do??
AleksI'd like to, but... now it's gone from 1% to dead, and I can't bring it back to life, whether plugged in or not!
When it's plugged in, the red charging light doesn't even come up. When I hard reset it, it just vibrates as it should, but no charging light whatsoever. When I unplug it and try to start it, the red light just flashes three times.
Now I'll just try to leave it plugged in for some time, in hope that there will be enough charge to try to boot into safe mode.
But to me, it seems like some kind of hardware bug? I mean, it seems like the same problen bothers the phone even when it's shut down, so I wouldn't gess it's a problem with the apps or the system! But I just don't get why it worked all the time and then just suddenly this thing happens! I've had it now for 6 weeks, and I already had a similar problem on the second day already, but it went away with a hard reset while charging... after that, perfect charging and good battery life for 6 weeks!
Regards,
Aleks -
Error while creating a Service PO using BAPI_PO_CREATE1
Hi,
Im facing Error as "In case of account assignment, please enter acc. assignment data for item" while creating Service PO using BAPI_PO_CREATE1.
Header Data
w_poheader-comp_code = w_src-bukrs. "Company Code
w_poheader-doc_type = w_src-bsart. "Document type
w_poheader-delete_ind = w_src-vrtkz. "Deletion Indicator
CLEAR: lv_date.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = w_src-aedat
IMPORTING
date_internal = lv_date
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
w_poheader-creat_date = lv_date. "Creation Date
w_poheader-created_by = sy-uname. "Creator Name
w_poheader-vendor = w_src-lifnr. "Vendor
w_poheader-pmnttrms = w_src-zterm. "Payment Terms
w_poheader-purch_org = w_src-ekorg. "Purchase Organization
w_poheader-pur_group = w_src-ekgrp. "Purchase Group
w_poheader-ref_1 = w_src-ihrez. "OLD PO
w_poheaderx-comp_code = 'X'. "Company Code
w_poheaderx-doc_type = 'X'. "Document type
w_poheaderx-delete_ind = 'X'. "Deletion Indicator
w_poheaderx-creat_date = 'X'. "Creation Date
w_poheaderx-created_by = 'X'.
w_poheaderx-vendor = 'X'.
w_poheaderx-pmnttrms = 'X'. "Payment Terms
w_poheaderx-purch_org = 'X'. "Purchase Organization
w_poheaderx-pur_group = 'X'. "Purchase Group
w_poheaderx-ref_1 = 'X'.
Item Data
w_poitem-po_item = w_src-ebelp.
IF NOT w_src-elikz IS INITIAL.
w_poitem-delete_ind = w_src-elikz.
ENDIF.
IF NOT w_src-txz01 IS INITIAL.
w_poitem-short_text = w_src-txz01.
ENDIF.
IF NOT w_src-werks IS INITIAL.
w_poitem-plant = w_src-werks.
ENDIF.
Material group
IF NOT w_src-matkl IS INITIAL.
w_poitem-matl_group = w_src-matkl.
ENDIF.
Open or Partial Qty
IF w_src-opqty IS NOT INITIAL.
w_poitem-quantity = w_src-opqty.
ELSEIF NOT w_src-paqty IS INITIAL.
w_poitem-quantity = w_src-paqty.
ENDIF.
IF NOT w_src-meins IS INITIAL.
w_poitem-po_unit = w_src-meins. "Base Unit of Measure
ENDIF.
IF NOT w_src-netpr IS INITIAL.
w_poitem-net_price = w_src-netpr. "Net Price
ENDIF.
IF NOT w_src-mwskz IS INITIAL.
w_poitem-tax_code = w_src-mwskz.
ENDIF.
IF NOT w_src-pstyp IS INITIAL.
w_poitem-item_cat = w_src-pstyp.
ENDIF.
IF NOT w_src-knttp IS INITIAL.
w_poitem-acctasscat = w_src-knttp.
ENDIF.
IF NOT w_src-vrtkz IS INITIAL.
w_poitem-distrib = w_src-vrtkz.
ENDIF.
Package No
IF NOT w_src-packno IS INITIAL.
w_poitem-pckg_no = w_src-packno. "Package no
ENDIF.
IF w_poitem-delete_ind IS INITIAL AND
w_poitem-short_text IS INITIAL AND
w_poitem-plant IS INITIAL AND
w_poitem-matl_group IS INITIAL AND
w_poitem-quantity IS INITIAL AND
w_poitem-po_unit IS INITIAL AND
w_poitem-net_price IS INITIAL AND
w_poitem-tax_code IS INITIAL.
CLEAR lv_item.
ELSE.
APPEND w_poitem TO i_poitem.
CLEAR: w_poitem.
lv_item = 'X'.
ENDIF.
w_poitemx-po_item = w_src-ebelp.
w_poitemx-delete_ind = 'X'.
w_poitemx-short_text = 'X'.
w_poitemx-plant = 'X'.
w_poitemx-matl_group = 'X'.
w_poitemx-quantity = 'X'.
w_poitemx-po_unit = 'X'.
w_poitemx-net_price = 'X'.
w_poitemx-tax_code = 'X'.
w_poitemx-item_cat = 'X'.
w_poitemx-acctasscat = 'X'.
w_poitemx-distrib = 'X'.
IF NOT w_src-packno IS INITIAL.
w_poitemx-pckg_no = 'X'.
ENDIF.
IF lv_item = 'X'.
APPEND w_poitemx TO i_poitemx.
CLEAR: w_poitemx,
lv_item.
ENDIF.
PO Deliery Address
w_poaddrdelivery-po_item = w_src-ebelp.
IF NOT w_src-adrn2 IS INITIAL.
w_poaddrdelivery-addr_no = w_src-adrn2.
APPEND w_poaddrdelivery TO i_poaddrdelivery.
CLEAR w_poaddrdelivery.
ENDIF.
POschedule
w_poschedule-po_item = w_src-ebelp.
CLEAR: lv_date.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = w_src-eindt
IMPORTING
date_internal = lv_date
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
IF NOT lv_date IS INITIAL.
w_poschedule-del_datcat_ext = 'D'. "Delivery Date in Day Format
w_poschedule-delivery_date = lv_date.
w_poschedule-quantity = w_src-menge.
APPEND w_poschedule TO i_poschedule.
CLEAR w_poschedule.
lv_schd = 'X'.
ENDIF.
w_poschedulex-po_item = w_src-ebelp.
w_poschedulex-del_datcat_ext = 'X'.
w_poschedulex-delivery_date = 'X'.
w_poschedulex-quantity = 'X'.
IF lv_schd = 'X'.
APPEND w_poschedulex TO i_poschedulex.
CLEAR : w_poschedulex,
lv_schd.
ENDIF.
PO Account Assignment
w_poaccount-po_item = w_src-ebelp.
w_poaccount-serial_no = w_src-zekkn.
Distribution Indicator is 1
IF w_src-vrtkz EQ '1'.
w_poaccount-distr_perc = w_src-vproz.
IF NOT w_src-menge IS INITIAL.
CLEAR lv_menge.
lv_menge = w_src-menge.
ENDIF.
lv_acct_qty = lv_menge * w_src-vproz / 100.
Get Round value of Quanity
frac = FRAC( lv_acct_qty ).
IF frac EQ 0.
lv_acct_qty = FLOOR( lv_acct_qty ).
ELSE.
lv_acct_qty = CEIL( lv_acct_qty ).
ENDIF.
w_poaccount-quantity = lv_acct_qty.
ELSEIF w_src-vrtkz IS INITIAL.
w_poaccount-quantity = w_src-menge.
ENDIF.
w_poaccount-gl_account = w_src-saknr.
w_poaccount-costcenter = w_src-kostl.
w_poaccount-asset_no = w_src-anln1.
w_poaccount-wbs_element = w_src-wbs.
w_poaccount-network = w_src-nplnr.
w_poaccount-tax_code = w_src-mwskz.
w_poaccount-activity = w_src-vornr.
APPEND w_poaccount TO i_poaccount.
CLEAR w_poaccount.
w_poaccountx-po_item = w_src-ebelp.
w_poaccountx-serial_no = w_src-zekkn.
IF w_src-vrtkz EQ '1'.
w_poaccountx-distr_perc = 'X'.
ENDIF.
w_poaccountx-quantity = 'X'.
w_poaccountx-gl_account = 'X'.
w_poaccountx-costcenter = 'X'.
w_poaccountx-wbs_element = 'X'.
w_poaccountx-network = 'X'.
w_poaccountx-tax_code = 'X'.
w_poaccountx-activity = 'X'.
APPEND w_poaccountx TO i_poaccountx.
CLEAR w_poaccountx.
PO Services
w_poservices-pckg_no = w_src-packno. "Package no
w_poservices-line_no = w_src-srv_line_no. "Line item
w_poservices-ext_line = w_src-extrow. "External line
w_poservices-outl_level = 0.
w_poservices-outl_ind = 'X'.
w_poservices-subpckg_no = w_src-sub_packno. "Sub package no
w_poservices-quantity = w_src-srqty. "Service Quantity
w_poservices-base_uom = w_src-srmeins. "Service Basic unit of Measure
w_poservices-price_unit = '1'.
w_poservices-from_line = '1'.
w_poservices-gr_price = w_src-brtwr. "GR Price
w_poservices-short_text = w_src-sh_text1. "Service Short Text
w_poservices-matl_group = w_src-matkl. "Material Group
APPEND w_poservices TO i_poservices.
CLEAR w_poservices.
PO Service Access values
w_posrvacc-pckg_no = w_src-packno. "Package no
w_posrvacc-line_no = w_src-srv_line_no. "Line item
w_posrvacc-serno_line = w_src-zekkn. "'01'..
IF w_src-vproz IS INITIAL.
w_posrvacc-percentage = '100.0'.
ENDIF.
w_posrvacc-serial_no = w_src-zekkn. "'01'.
w_posrvacc-quantity = w_src-srqty. "Service Quantity
w_posrvacc-net_value = w_src-srqty. "Net value
APPEND w_posrvacc TO i_posrvacc.
CLEAR w_posrvacc.
ENDIF.
***Create a NEW PO
AT END OF ihrez.
Call BAPI
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = w_poheader
poheaderx = w_poheaderx
IMPORTING
exppurchaseorder = gv_ebeln
TABLES
return = i_return
poitem = i_poitem[]
poitemx = i_poitemx[]
poaddrdelivery = i_poaddrdelivery[]
poschedule = i_poschedule[]
poschedulex = i_poschedulex[]
poaccount = i_poaccount[]
poaccountx = i_poaccountx[]
poservices = i_poservices[]
posrvaccessvalues = i_posrvacc[]
extensionin = i_extensionin[].
Commit the Transaction
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
Regards,
Deepthi.1. If we get error as "In case of account assignment, please enter acc. assignment data for item" than First cehck whetaher u have authorization to Tcode ME23n or not. In my case, I din't had authorization to Me23n tcode.
2. If we get Error as "Please Mainatain Services or Limits". Please create a Service PO in the following Order.
*& Internal Table Declaration
DATA : i_intern TYPE STANDARD TABLE OF alsmex_tabline WITH HEADER LINE,
i_poitem TYPE STANDARD TABLE OF bapimepoitem,
i_poitemx TYPE STANDARD TABLE OF bapimepoitemx,
i_poaddrdelivery TYPE STANDARD TABLE OF bapimepoaddrdelivery,
i_poschedule TYPE STANDARD TABLE OF bapimeposchedule,
i_poschedulex TYPE STANDARD TABLE OF bapimeposchedulx,
i_poaccount TYPE STANDARD TABLE OF bapimepoaccount,
i_poaccountx TYPE STANDARD TABLE OF bapimepoaccountx,
i_poservices TYPE STANDARD TABLE OF bapiesllc,
i_posrvacc TYPE STANDARD TABLE OF bapiesklc,
i_extensionin TYPE STANDARD TABLE OF bapiparex,
i_return TYPE STANDARD TABLE OF bapiret2.
*& Work Area Declaration
DATA:
w_poheader TYPE bapimepoheader,
w_poheaderx TYPE bapimepoheaderx,
w_poitem TYPE bapimepoitem,
w_poitemx TYPE bapimepoitemx,
w_poaddrdelivery TYPE bapimepoaddrdelivery,
w_poschedule TYPE bapimeposchedule,
w_poschedulex TYPE bapimeposchedulx,
w_poaccount TYPE bapimepoaccount,
w_poaccountx TYPE bapimepoaccountx,
w_poservices TYPE bapiesllc,
w_posrvacc TYPE bapiesklc,
w_extensionin TYPE bapiparex,
w_return TYPE bapiret2.
START-OF-SELECTION.
Header Data
w_poheader-comp_code = '5791'. "Company Code
w_poheader-doc_type = 'Z0CM'. "Document type
w_poheader-creat_date = sy-datum. "lv_date. "Creation Date
w_poheader-created_by = sy-uname. "Creator Name
w_poheader-vendor = '0005012343'. "Vendor
w_poheader-pmnttrms = 'Z004'. "Payment Terms
w_poheader-purch_org = 'P000'. "Purchase Organization
w_poheader-pur_group = '001'. "Purchase Group
w_poheader-ref_1 = '004500007671'. "OLD PO
w_poheaderx-comp_code = 'X'. "Company Code
w_poheaderx-doc_type = 'X'. "Document type
w_poheaderx-creat_date = 'X'. "Creation Date
w_poheaderx-created_by = 'X'.
w_poheaderx-vendor = 'X'.
w_poheaderx-pmnttrms = 'X'. "Payment Terms
w_poheaderx-purch_org = 'X'. "Purchase Organization
w_poheaderx-pur_group = 'X'. "Purchase Group
w_poheaderx-ref_1 = 'X'.
Item Data
w_poitem-po_item = '000010'.
w_poitem-short_text = 'Z0CM - Default Appr. Test '.
w_poitem-plant = '5368'.
Trackign no
w_poitem-trackingno = ''.
Material group
w_poitem-matl_group = '119'.
w_poitem-po_unit = 'EA'. "Base Unit of Measure
w_poitem-net_price = '17500.00'. "Net Price
w_poitem-tax_code = 'I0'.
w_poitem-item_cat = '9'.
w_poitem-acctasscat = 'K'.
w_poitem-distrib = space.
Package must be given in item to create Service PO
w_poitem-pckg_no = 0000000001.
APPEND w_poitem TO i_poitem.
CLEAR: w_poitem.
w_poitemx-po_item = '000010'.
w_poitemx-delete_ind = 'X'.
w_poitemx-short_text = 'X'.
w_poitemx-plant = 'X'.
w_poitemx-trackingno = 'X'.
w_poitemx-matl_group = 'X'.
w_poitemx-quantity = 'X'.
w_poitemx-po_unit = 'X'.
w_poitemx-net_price = 'X'.
w_poitemx-tax_code = 'X'.
w_poitemx-item_cat = 'X'.
w_poitemx-acctasscat = 'X'.
w_poitemx-distrib = 'X'.
w_poitemx-pckg_no = 'X'.
APPEND w_poitemx TO i_poitemx.
CLEAR: w_poitemx.
PO Deliery Address
w_poaddrdelivery-po_item = '000010'.
w_poaddrdelivery-addr_no = '0000061208'.
APPEND w_poaddrdelivery TO i_poaddrdelivery.
CLEAR w_poaddrdelivery.
POschedule
w_poschedule-po_item = '000010'..
DATA : LV_DATE TYPE SY-DATUM,
lv_schd.
CLEAR: lv_date.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = '12/2/2009'
IMPORTING
date_internal = lv_date
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
IF NOT lv_date IS INITIAL.
w_poschedule-del_datcat_ext = 'D'. "Delivery Date in Day Format
w_poschedule-delivery_date = lv_date.
w_poschedule-quantity = '1.000'.
APPEND w_poschedule TO i_poschedule.
CLEAR w_poschedule.
lv_schd = 'X'.
ENDIF.
w_poschedulex-po_item = '000010'.
w_poschedulex-del_datcat_ext = 'X'.
w_poschedulex-delivery_date = 'X'.
w_poschedulex-quantity = 'X'.
IF lv_schd = 'X'.
APPEND w_poschedulex TO i_poschedulex.
CLEAR : w_poschedulex,
lv_schd.
ENDIF.
PO Account Assignment
w_poaccount-po_item = '000010'.
w_poaccount-serial_no = '01'.
w_poaccount-distr_perc = ''.
w_poaccount-quantity = '1.000'.
w_poaccount-gl_account = '0000603064'.
w_poaccount-costcenter = '0053680100'.
w_poaccount-asset_no = ''.
w_poaccount-wbs_element = ''.
w_poaccount-network = ''.
w_poaccount-tax_code = 'I0'.
w_poaccount-activity = ''.
APPEND w_poaccount TO i_poaccount.
CLEAR w_poaccount.
w_poaccountx-po_item = '000010'.
w_poaccountx-serial_no = '01'.
w_poaccountx-distr_perc = 'X'.
w_poaccountx-quantity = 'X'.
w_poaccountx-gl_account = 'X'.
w_poaccountx-costcenter = 'X'.
w_poaccountx-wbs_element = 'X'.
w_poaccountx-network = 'X'.
w_poaccountx-tax_code = 'X'.
w_poaccountx-activity = 'X'.
w_poaccountx-cmmt_item = 'X'.
APPEND w_poaccountx TO i_poaccountx.
CLEAR w_poaccountx.
Extension for ZZSub
w_extensionin-structure = 'BAPI_TE_MEPOACCOUNTING'.
w_extensionin-valuepart1+0(5) = '00010'..
w_extensionin-valuepart1+5(2) = '01'.
w_extensionin-valuepart1+28(5) = ''.
APPEND w_extensionin TO i_extensionin.
CLEAR w_extensionin.
w_extensionin-structure = 'BAPI_TE_MEPOACCOUNTINGX'.
w_extensionin-valuepart1+0(5) = '00010'.
w_extensionin-valuepart1+5(2) = '01'.
w_extensionin-valuepart1+11(1) = 'X'.
APPEND w_extensionin TO i_extensionin.
CLEAR w_extensionin.
Extension to add Expense Type only
w_extensionin-structure = 'BAPI_TE_MEPOHEADER'.
w_extensionin-valuepart1+10(4) = '0131'.
APPEND w_extensionin TO i_extensionin.
CLEAR w_extensionin.
w_extensionin-structure = 'BAPI_TE_MEPOHEADERX'.
w_extensionin-valuepart1+10(4) = 'X'.
APPEND w_extensionin TO i_extensionin.
CLEAR w_extensionin.
EXPORT i_extensionin[] TO MEMORY ID 'SUB'.
PO Services
PO Services( One Line Iem)
Assign the dummy no as Pacakage no
w_poservices-pckg_no = 0000000001. "(assign package no as a dummy number)
w_poservices-line_no = 0000000001. "Line item
w_poservices-outl_ind = 'X'.
Assign Dummy no as sub package no
w_poservices-subpckg_no = 0000000003. "(Dummy No.) "Sub package no
w_poservices-from_line = '1'.
APPEND w_poservices TO i_poservices.
CLEAR w_poservices.
PO Services(Second Line Item )
Assign the same sub package dummy no which is mentioned above
w_poservices-pckg_no = 0000000003. "(Dummy No.) "Sub package no
w_poservices-line_no = 0000000002.
w_poservices-ext_line = '0000000010'. "External line
w_poservices-quantity = '17500.0'. "Service Quantity
w_poservices-base_uom = 'EA'. "Service Basic unit of Measure
w_poservices-price_unit = '1'.
w_poservices-gr_price = '1'. "GR Price
w_poservices-short_text = 'Z0CM - Default Appr. T'. "Service Short Text
w_poservices-matl_group = '119'. "w_src-matkl. "Material Group
APPEND w_poservices TO i_poservices.
CLEAR w_poservices.
PO Service Access values
w_posrvacc-pckg_no = 0000000003. "w_src-sub_packno. "Sub package no
w_posrvacc-line_no = 0000000002. "w_src-srv_line_no. "Line item
w_posrvacc-serno_line = '01'.
w_posrvacc-percentage = '100.0'.
w_posrvacc-serial_no = '01'.
w_posrvacc-quantity = '17500.0'. "w_src-srqty. "Service Quantity
APPEND w_posrvacc TO i_posrvacc.
CLEAR w_posrvacc.
DATA : gv_ebeln TYPE ebeln.
Call BAPI
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = w_poheader
poheaderx = w_poheaderx
IMPORTING
exppurchaseorder = gv_ebeln
TABLES
return = i_return
poitem = i_poitem[]
poitemx = i_poitemx[]
poaddrdelivery = i_poaddrdelivery[]
poschedule = i_poschedule[]
poschedulex = i_poschedulex[]
poaccount = i_poaccount[]
poaccountx = i_poaccountx[]
poservices = i_poservices[]
posrvaccessvalues = i_posrvacc[]
extensionin = i_extensionin[].
Commit the Transaction
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
WRITE:/5 gv_ebeln COLOR 5.
SKIP 2.
DATA : lv_msg TYPE string.
LOOP AT i_return INTO w_return WHERE type = 'E'.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = w_return-id
lang = 'EN'
no = w_return-number
v1 = w_return-message_v1
v2 = w_return-message_v2
v3 = w_return-message_v3
v4 = w_return-message_v4
IMPORTING
msg = lv_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
WRITE:/10 lv_msg.
ENDLOOP.
Maybe you are looking for
-
Error message in distribution status of crmd_order
Hi All, We are working on CRM 2007. After saving the transaction type in cRMD_ORDER the distribution status attribute in the status view is showing as "Error in distribution". But still we can find the document being available in ECC. Please help us
-
like i posted yesterday,ever since the stupid 8.0.1 update this c***** web browser has been freezing more then it was before. i would love to switch to google chrome or internet explorer,but google chrome freezes my computer up,and i can't get intern
-
I just updated my C7 to Anna 022014 using Nokia software updater and it tells me I am up to date and no more to download but if I go to Ovi suite it has Anna updates in 2 parts but gives an error half way through which I see many people are getting s
-
Firmware uprade..How to do it if I have 1.40
I have brand new ZVM 30Gig I bought months ago but never used. I see that it has .40.02 firmware version. Latest firmware is .62.02. then there is also a .50.02 if I am not mistaken. So do I upgrade first to .50.02 *then* .62.02 or can I go directly
-
I am having trouble uploading photos from Elements 9 to Facebook. After completing authorization page I get Error -Unknown -error . Does anyone know how to fix this.