Porder
Hi,
I need tables for delivery address from PO, delivery address tab in case of third party customer address would be seleceted, if subcontracting then vendor addres would be selected
how to write table for this
Hi,
Please give the your PO no. in EKKO table find the required field (third party customer & SC vendor) in this table.
with adress fields,customer search in ADRC table.
Regards
Lokesh
Similar Messages
-
Object key for PORDER (document links, table DRAD)
Hi,
the object key for PORDER entries in table DRAD looks like:
000003054845O00000000000020000000020000
what i know:
character 1 to 12: ordernumber (AFKO-AUFNR)
character 18 to 23: sequencenumber (AFVC-PLNFL)
character 24 to 27: operationnumber (AFVC-VORNR)
character 28 to 35: counter (AFVC-APLZL)
so whats about character 13 to 17 and 36 to 40?
Thanks, MartinHello Martin,
Look at the field OBJECT which indicates which is the table for which the key OBJECT Key is populated. Check the table indicated in the OBJECT field and the key for the field is the same as the value for OBJECT KEY. -
PORDER object links copying to new version
When a new version of a document is created as a copy of the previous version, the PORDER object links are being copied to the new version along with the MARA links. This results in the PORDER record being in the DRAD table but not the DRAD_PORDER table, which ultimately shows the incorrect document version on production orders. This only happens when the document version is created in a source client and ALE'd to a target client. If we manually create a new document version using a template, we are OK. Our configuration is set up to not maintain object links via ALE.
Has anyone else had this happen, or have any ideas on where we can look?
Thank you,
MelissaI think we found our problem. In configuration for defining the object links for a document type, we needed to uncheck the Obj Link Target Syst checkbox. (While still keeping the No Maint via ALE checked).
Regards,
Melissa -
Save EAN11 field while creating POrder creation through Function module
Hi All,
I want to update EAN11 field in material master while creating Purchase Order through function module. I am using function module BAPI_PO_CREATE1 for creating purchase order. There are no structures in the PO creation FM in which EAN11 field is there. I have also tried using function module MEPO_DOC_ITEM_PROCESS for updating EAN11 field. It is not working. Please suggest some method to do that.
Note: I am receiving EAN11 through an external system by proxy.
Thanks,
ChinmayHi,
Use BAPI_MATERIAL_SAVEDATA to updat ean numbers for materials.
tables INTERNATIONALARTNOS is used to update EAN.
Regards,
Shanmugavel Chandrasekaran -
hi frnds,
i am facing a sictuation that i hav to create a report about the excise invoice details.
i know th tables
t001w
j_1iexchdr
ekpo
ekbe
i want to extrat data by using for all entries
i want how to extrat the data that means key relations abt the tables
thanks,
karunakar
Moderator message: please see my message in your previous post.
Edited by: Thomas Zloch on Jun 30, 2011 11:10 AMYour question is a little confusng - Do you mean to say you want to view the Excise info also ? If so, how is it being recorded on an invoice - Based on that, you would be able to add that field in the T Code FBL5N.
-
Upload option is not available in Pord database webadi
Dear
We wanted to create api for assignment pupation via web adi tool. Initially we created document on test and working fine, but when we was using the same option on prod, there were not option available in excel file to upload data in oracle,
Could you please advice
--thanksThanks for reply once again,
Actually we want to update assignment through api, therefore we are using Package “HR_ASSIGNMENT_API.UPDATE_EMP_ASG_CRITERIA”, but there are three procedure with the same name in this package, so how oracle get my required procedure because all of three are different parameters,
I have defined value in the Excel document are below mentioned.
Metadata Type = UPDATE
Application Short Name = PER
Integrator User Name = UPDATE_ASSIGNMENT
View Name = UPDATE_ASSIGNMENT
Form Name = GENERAL
API Package Name = HR_ASSIGNMENT_API
API Procedure Name = UPDATE_EMP_ASG_CRITERIA
Interface User Name = Update Assignment
Interface Parameter List Name = Update Assignment
API Type = PROCEDURE
Have any body experienced in this regard.
--thanks -
Dash Board in BO pord server is showing error
HI Expert,
While i open my dash board in BO production server it showing me error
"A database error occured. The database error text is: Unable to connect to SAP BW server SAP_CMINIT3 : rc=20 > Connect to SAP gateway failed
Connect_PM GWHOST=172.16.5.44, GWSERV=sapgw00, ASHOST=172.16.5.44, SYSNR=00
LOCATION SAP-Gateway on host pagebip / sapgw00
ERROR max no of cpic clients exceeded (300)
TIME Fri May 20 19:20:13 201
RELEASE 700
COMPONENT SAP-Gateway
VERSION 2
RC 633
MODULE gwxxrd.c
LINE 8386
COUNTER 6311
. (WIS 10901)"
Please tell me how to resolve this error, because sometimes dash board is working properly,
Thanks and Regards
Lalit KumarHi Experts,
I am waiting for reply.
Thanks and Regards
Lalit Kumar -
I am using tye datasrc 2lis_11_v_itm for loading oen order qty & open porder values in to cube 0sd_c03
When I compare these values with va05 eneter sold to party & sale org,document date selct open sales orders & execute
Then in that report I am checking the fields Netwr_Ak ,Wmeng
But the values are not matching I am using the std updaterules & I didnot changein the update rules of 2LIS_11_V_ITM when i check particular routine tme chars Calendar Year/Month is mapped to Date on which the record was created where as for other updare rules like 2LIS_11_VAITM ,2LIS_13_VDITMCalendar Year/Month is mapped to Update Date Statistics
Is it bacuse of this its not displaying the correct values -
Production order report on Daily
Hi gurus,
I tried to create a report for production orders. it contain four selection parameters. Here i am using four tables 1) crhd 2) caufv 3) aufk 4) afru 5) zbreak ( this is a ztable created by me ) . i need the fields like date,work centre, porder,startdate,enddate,order quantity,processed quantity,yield,scrap, (down time ,from time ,reason these all from ztable). i want to make one report on this.
i did it in two ways. I used a join statement but it is taking more time to execute. i know this is a performance issue. please give me a good idea how to finish this report.
<< Please repect the 2,500 character limit on posts. Post only the relevant portion of your code. And please use code tags.>>
form get_data.
select
a~arbpl
b~plnbez
c~aufnr
d~rueck
d~isdd
d~iedd
b~gamng
d~lmnga
d~xmnga
d~rmnga
e~from_time
e~to_time
e~total_time
e~workcentre
e~reason
into table itab
* (itab-arbpl, itab-plnbez, itab-aufnr,
* itab-rueckb itab-isdd itab-iedd,
* itab-gamng, itab-lmnga, itab-xmnga,
* itab-rmnga ,itab-from_time, itab-to_time,
* itab-total_time, itab-workcenter, itab-reason)
from ( ( crhd as a
inner join caufv as b
on a~werks = b~werks
inner join aufk as c
on c~werks = b~werks
inner join afru as d
on d~werks = c~WERKS )
inner join ZBREAK_DOWN_TIME as e
on e~werks = d~werks )
WHERE PLNBEZ IN S_MATNR.
append itab.
endform.
Thank you.
Edited by: Rob Burbank on Jan 3, 2010 2:09 PMHi MadhuRao,
My observations in your current SELECT statement are as follows:
1. In your query you are selecting AUFNR from the table AUFK which is already there in the view CAUFV which you have already included. So this is un-necessary.
2. There is no index for WERKS in table CRHD (Work Center Header) table. You should read the work centers separately in a hash table and read to fill your main internal table.
3. You should join Order table (view CAUFV) and Order confirmations (AFRU) based on order number (AUFNR). Currently you are joining based on plant (WERKS) which is also another serious performance issue.
My suggestions are:
1. SELECT all the Work-Centers from CRHD into an internal table.
2. SELECT from CAUFV first for the given list of material numbers (which is the only WHERE clause field in your query). This must be your main internal table itab.
3. Consolidate all the unique Order Numbers (AUFNR) and if possible the counter (APLZL) into a separate internal table.
4. SELECT from the confirmation table (AFRU) for the list of above orders only.
5. Loop through your main internal table itab and update the fields from the Work-Center and Confirmation internal tables.
This would greatly improve the performance, however your code will be huger.
Cheers
Suresh -
Dear All,
At the time of PR value change after creation of PO budget exceeded error is not appearing even though the PR value exceeds the budget. But at the time of changing the same value in PO, budget exceeded error is appearing.
List of steps:
PR created.
PR released
PO created with reference to PR and released.
PR value changed to a value more than the available budget - No budget exceeded error.
PO value changed in accordance with the PR - System throwing the budget exceeded error.
Now the issue is why the system bypassed the budget exceeded error at the time of PR value change and only giving the error at the time of PO value change. Also, we observed that while changing the quantity in PR which results in exceeding budget, system is giving the error. But while changing the value system is not giving the budget exceeded error.
Your inputs will be highly appreciated. Thanks in advance.Hello Saurabh,
Thank you for your inputs. Below is the output of CJI5.
Ref,Doc Category Debit Date Oty Object Cost Elem. Val/CO Area Crcy Total Qty. UM
PREQ 28.05.2014 WBS XXXXXX XXXXXX 0.00 0 EA
POrd 28.05.2014 WBS 14,000.00 1000 EA
From the above output i think system is not capturing the PR commitment. I'm not sure as i'm basically into MM and dont know much about PS.
Why the system is stopping with budget exceeded error at the time of PR creation and not giving any error while changing the PR value after PO creation. System is giving budget exceeded error if quantity is changed in PR. Please explain the standard system behavior and suggest how to enable control at the time of PR value change.
Thanks in advance. -
Problem creating Purchase Order with Bapi_po_create Return Message is ""
Hello everybody
When I get to create PO with bapi_po_create . I get this message in the return parameter :"Enter the PURCH_ORG".
I think that I have implemented it very well but I don´t get the results that I was expected : No PO was created.
Please see the following codes and let me know if something is wrong. Thanks .
=====================================
*& Report Z_PED_TRAS *
REPORT z_ped_tras .
Definición de la tabla asociada la tabla interna bdcdata
*DATA :in_data LIKE bdcdata OCCURS 0 WITH HEADER LINE.
Definición de la estructura que contendrá los pedidos
DATA : s_cabeceras_pedidos LIKE bapiekkoc,
s_pos_pedidos LIKE bapiekpoc.
DATA : t_cabeceras_pedidos LIKE bapiekkoc OCCURS 0 WITH HEADER LINE,
t_pos_pedidos LIKE bapiekpoc OCCURS 0 WITH HEADER LINE,
t_final_cabeceras_pedidos LIKE bapiekkoc OCCURS 0 WITH HEADER
LINE,
t_final_pos_pedidos LIKE bapiekpoc OCCURS 0 WITH HEADER LINE.
Data : item_schedule like BAPIEKET occurs 0 with header line.
*DATA : BEGIN OF pedidos,
ematn TYPE mepo1211-ematn, "Número de material
menge TYPE mepo1211-menge, "Cantidad de pedido
name1 TYPE mepo1211-name1," Centro destino
lgobe TYPE mepo1211-lgobe, "Almacén
END OF pedidos.
*DATA: s_pedidos LIKE pedidos,
wa_pedidos LIKE pedidos,
t_pedidos LIKE pedidos OCCURS 0 .
Variables auxiliaires
Variables para la ejecución del explorador de archivos
DATA: l_temp_dir TYPE string.
DATA: l_filter TYPE string.
DATA: l_files TYPE filetable.
DATA: l_rc TYPE i.
DATA: l_file TYPE filename.
DATA: l_filename TYPE string.
DATA: excel TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
DATA: s_excel TYPE alsmex_tabline.
DATA: qid LIKE apqi-qid.
Declaración de parametros de selección
PARAMETERS :
p_center LIKE bapiekkoc-suppl_plnt OBLIGATORY,"" Proveedor/Centro
p_ekorg LIKE bapiekkoc-purch_org OBLIGATORY , " Organización compras
p_ekgrp LIKE bapiekkoc-pur_group OBLIGATORY, " Grupo de compras
p_bukrs LIKE bapiekkoc-co_code OBLIGATORY,"Sociedad"
p_date LIKE sy-datum DEFAULT sy-datum OBLIGATORY, "fecha
test AS CHECKBOX DEFAULT 'X'.
p_center LIKE mepo_topline-superfield, " Proveedor/Centro
p_ekorg LIKE mepo1222-ekorg, " Organización de compras
p_ekgrp LIKE mepo1222-ekgrp, " Grupo de compras
p_bukrs LIKE mepo1222-bukrs,"Sociedad"
p_date LIKE sy-datum," Fecha
test AS CHECKBOX DEFAULT 'X'.
PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'C:PEDIDOS.XLS'. " Ruta
Carga del explorador de ficheros **
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
l_temp_dir = 'C:A'.
l_filter = '.'.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
default_extension = '*.xls'
file_filter = l_filter
initial_directory = l_temp_dir
CHANGING
file_table = l_files
rc = l_rc
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF NOT l_files[] IS INITIAL.
READ TABLE l_files INTO l_file INDEX 1.
p_file = l_file.
TRANSLATE p_file TO UPPER CASE.
ENDIF.
START-OF-SELECTION.
IF p_file NE space.
PERFORM upload_data.
PERFORM fill_data.
PERFORM llamar_bapi.
ENDIF.
END-OF-SELECTION.
*& Form Upload_data
text
--> p1 text
<-- p2 text
FORM upload_data .
IF excel IS INITIAL .
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 2
i_end_col = 4
i_end_row = 50000
TABLES
intern = excel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE :/'Hay un problema al cargar los datos delfichero excell'.
ENDIF.
SORT excel DESCENDING BY row col.
ENDIF.
ENDFORM. " Upload_data
*& Form fill_excell
text
--> p1 text
<-- p2 text
FORM fill_data .
DATA : cant TYPE i ,
value_row TYPE i VALUE 1,
data_aux TYPE alsmex_tabline OCCURS 0 WITH HEADER LINE.
Leer las filas del fichero excell.
IF test NE 'X'.
s_cabeceras_pedidos-suppl_plnt = p_center.
s_cabeceras_pedidos-purch_org = p_ekorg.
s_cabeceras_pedidos-pur_group = p_ekgrp .
s_cabeceras_pedidos-co_code = p_bukrs .
s_cabeceras_pedidos-doc_date = p_date.
APPEND s_cabeceras_pedidos TO t_cabeceras_pedidos.
cant = excel-row.
DO cant TIMES.
LOOP AT excel WHERE row EQ value_row.
APPEND excel TO data_aux.
ENDLOOP.
SORT data_aux BY col.
LOOP AT data_aux.
CASE data_aux-col.
WHEN '1'.
s_pos_pedidos-pur_mat = data_aux-value.
WHEN '2'.
s_pos_pedidos-DISP_QUAN = data_aux-value.
WHEN '3'.
s_pos_pedidos-plant = data_aux-value.
WHEN '4'.
s_pos_pedidos-store_loc = data_aux-value.
ENDCASE.
ENDLOOP.
APPEND s_pos_pedidos TO t_pos_pedidos.
ENDDO.
ENDIF.
ENDFORM. " fill_data
*& Form llamar_Bapi
text
--> p1 text
<-- p2 text
FORM llamar_bapi .
data : T_RETURN LIKE BAPIRETURN OCCURS 0 WITH HEADER LINE,
PORDER LIKE BAPIEKKOC-PO_NUMBER.
t_final_cabeceras_pedidos[] = t_cabeceras_pedidos[].
t_final_pos_pedidos[] = t_pos_pedidos[].
CALL FUNCTION 'BAPI_PO_CREATE'
EXPORTING
po_header = t_final_cabeceras_pedidos
IMPORTING
PURCHASEORDER = PORDER
TABLES
po_items = t_final_pos_pedidos
po_item_schedules = item_schedule
RETURN = T_RETURN
IF sy-subrc EQ 0 .
WRITE :/ 'P O created well'.
ELSE .
WRITE :/ 'P .O was not created well'.
endif.
ENDFORM. " llamar_BapiHi,
When we use BAPI_PO_CREATE1 to create service PO, following tables are populated at item level:
a) POITEM
b) POITEMX
c) POACCOUNT
d) POACCOUNTX
e) POSERVICES
f) POSRVACCESSVALUES
For service items: POITEM-PCKG_NO = u20180000000001u2019. (assign package no as a dummy number)
Set PCKG_NO flag in POITEMX table as u2018Xu2019.
Package No is the link that connect POITEM table to POACCOUNT table through tables POSERVICES and POSRVACCESSVALUES.
Set POACCOUNT-SERIAL_NO to u201801u2019.
Set same PCKG_NO to u20180000000001u2019 in POSERVICES table. Maintain two entries in POSERVICES table like this:
WA_POSERVICES-PCKG_NO = u20180000000001u2019.
WA_POSERVICES-LINE_NO = u20180000000001u2019.
WA_POSERVICES-OUTL_IND = u2018Xu2019.
WA_POSERVICES-SUBPCKG_NO = u20180000000003u2019. (Dummy No.)
WA_POSERVICES-QUANTITY = u2018100.000u2019.
WA_POSERVICES-BASE_UOM = u2018EAu2019.
WA_POSERVICES-PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE TESTu2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
WA_POSERVICES- PCKG_NO = u20180000000003u2019.
WA_POSERVICES- LINE_NO = u20180000000002u2019.
WA_POSERVICES-QUANTITY = u201810.000u2019.
WA_POSERVICES- BASE_UOM = u2018EAu2019.
WA_POSERVICES--PRICE_UNIT = u20181u2019.
WA_POSERVICES-GR_PRICE = u2018100.000u2019.
WA_POSERVICES-SHORT_TEXT = u2018SERVICE 1u2019.
WA_POSERVICES-MATL_GROUP = u20180012u2019.
APPEND WA_POSERVICES TO IT_POSERVICES.
Set PCKG_NO as SUB_PCKG_NO in table POSRVACCESSVALUES this:
WA_POSRVACCESSVALUES-PCKG_NO = u20180000000003u2019.
WA_POSRVACCESSVALUES-LINE_NO = u20180000000002u2019.
WA_POSRVACCESSVALUES-SERNO_LINE = u201801u2019.
WA_POSRVACCESSVALUES-SERIAL_NO = u201801u2019.
WA_POSRVACCESSVALUES-QUANTITY = u201910.000u2019.
APPEND WA_POSRVACCESSVALUES TO IT_ POSRVACCESSVALUES.
This logic will work definitely and PO Service Items will be created.
Thanks & Regards.
Dhina.. -
How to persist data in the object n memory after fetching it once from database and use it with linq
Hi,
I have some data from the database around 8 to 10 records .
These records are interrelated and I need to show cascade drop down.
I want to get the records from the database using c#.
And then based on certain events on the page want to use linq over the same data without having to get the data from the data base again.
i.e
ProductName
Product Plan
Product type
Monthly
Annually
pordA
Gold
Individual
1
5
pordA
Gold
Spouse
2
6
pordA
Silver
Individual
3
7
pordA
Silver
Spouse
4
8
Prod B
Platinum
Individual
5
9
Prod B
Platinum
Spouse
6
10
Prod B
Gold
Individual
1
5
Prod B
Gold
Spouse
2
6
pordA
Silver
Individual
3
7
pordA
Silver
Spouse
4
8
pordA
Platinum
Individual
5
9
Now on page load I want product name in drop down.
Based on the productName selected i want to show Product Plan in another drop down and based on prduct plan want to show prduct type in drop down and then the annual and monthly in drop down.
I want to get all the records of prod A and then using linq to object load the drop downs instead of running query to database.
How can I keep the records available across the function calls.
Regards
VinodThis is mostly a ASP.NET question. You get better answers if you post it in ASP.NET forum.
This is my answer:
Session is not a suitable choice, since each user will have a duplicate of the data. Cache is a better option.
You can put something in Cache option and retrieve it from Cache similar to using Session. This is the manual method of caching and management of the cache content is on yourself.
public List<Product> GetAll()
List<Product> products = null;
if (Cache["Products"] == null)
DataSet data = RetrieveProducts();
products = ConvertProductsDataSetToObject(data);
Cache.Insert("Products", products, null, DateTime.Now.AddMinutes(30), TimeSpan.Zero);
else
products = (List<Product>)Cache["Products"];
return products;
When putting something in the cache, you should set its expire time. But one thing that is more important over this is to clear the cache when your data is changed in the data store (e.g. database).
public void UpdateProduct()
// update product in the database
// clear the cahce, so that the next request for Products, receives a fresh copy of the data
Cache["TestItem"] = null;
Other than using cache manually, there are also some helper funcationalities that manage cache automatically for you, based on the technology you use (ASP.NET Web Forms or ASP.NET MVC). For example in ASP.NET Web Forms you can ask ASP.NET Web Forms engine
to cache the output of a User Control automatocally by adding OutputCache directive to the user control. In ASP.NET MVC you can you [OutputCache] attribute and apply it to actions.
[OutputCache(Duration = 86400, Location = OutputCacheLocation.All)]
public ActionResult Index()
var model = ProductBL.GetAll();
return View(model);
Also, there is a concept named cache dependency, by which you can specify a dependency for the item being cached. When the condition is met, the cache automatically invalidates and clears.
There are three kinds of cache dependency:
Item dependency: make cached data dependent on another cached data
File dependency: make cached data dependent on a file
Sql dependency: make cached data dependent on the result of a SQL query -
hi
how to develo a report that displays vendor , porder and material details.Hi
See the sample report using LFA1,EKKO,EKPO tables Modify as per your requirement
*& Report ZMM_PO_REPORT
REPORT ZMM_PO_REPORT message-Id yb
NO STANDARD PAGE HEADING
LINE-COUNT 60(1)
LINE-SIZE 230.
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: lfa1, " Vendor Master
t161, " PO Doc Types
t024, " Purchase Groups
ekko. " PO Header
T Y P E S D E C L A R A T I O N S
Purchase Orders Main Structure
TYPES: BEGIN OF s_po,
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
bstyp TYPE bstyp, " PO Category
bukrs TYPE bukrs, " Company Code
bsart TYPE bbsrt, " PO Type
lifnr TYPE lifnr, " Vendor No
ekgrp TYPE bkgrp, " Purchase Group
waers TYPE waers, " Currency
bedat TYPE etbdt, " PO Date
txz01 TYPE txz01, " Material Text
werks TYPE ewerk, " Plant
lgort TYPE lgort_d, " Storage Location
matkl TYPE matkl, " Material Group
menge TYPE bamng, " PR Quantity
meins TYPE bamei, " UOM
bprme TYPE bbprm, " Price Unit
netpr TYPE netpr, " Net price
peinh TYPE peinh, " Price Unit UOM
pstyp TYPE pstyp, " Item Category
knttp TYPE knttp, " Account Assignment Category
END OF s_po.
Purchase Orders History Structure
TYPES: BEGIN OF s_account,
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
gjahr TYPE mjahr, " Fiscal Year
belnr TYPE mblnr, " PO Invoice No
menge TYPE menge_d, " PR Quantity
wrbtr TYPE wrbtr, " Price in Local Currency
dmbtr TYPE dmbtr, " Price in Foreign Currency
waers TYPE waers, " Currency
shkzg TYPE shkzg, " Dr/Cr Indicator
END OF s_account.
Purchase Orders History Structure(Item Sum)
TYPES: BEGIN OF s_inv_sum,
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
menge TYPE menge_d, " PR Quantity
wrbtr TYPE wrbtr, " Price in Foreign Currency
waers TYPE waers, " Currency
END OF s_inv_sum.
Purchase Orders Main Structure
TYPES: BEGIN OF s_rep,
lifnr TYPE lifnr, " Vendor No
ebeln TYPE ebeln, " PO No.
ebelp TYPE ebelp, " PO Item
bstyp TYPE bstyp, " PO Category
bsart TYPE bbsrt, " PO Type
ekgrp TYPE bkgrp, " Purchase Group
waers TYPE waers, " Currency
bedat TYPE etbdt, " PO Date
txz01 TYPE txz01, " Material Text
werks TYPE ewerk, " Plant
lgort TYPE lgort_d, " Storage Location
matkl TYPE matkl, " Material Group
menge TYPE bamng, " PR Quantity
meins TYPE bamei, " UOM
bprme TYPE bbprm, " Price Unit
netpr TYPE netpr, " Net price
peinh TYPE peinh, " Price Unit UOM
pstyp TYPE pstyp, " Item Category
knttp TYPE knttp, " Account Assignment Category
name1 TYPE name1, " Plant
orewr TYPE netpr, " To be Invoiced Price
curr TYPE waers, " Inv Doc Currency
END OF s_rep.
D A T A D E C L A R A T I O N S
DATA: gv_title1 TYPE sylisel, " Report title
gv_dial. " Color flag
C O N S T A N T S D E C L A R A T I O N S
CONSTANTS: c_x VALUE 'X', " Flag X
c_h VALUE 'H', " Debit
c_vgabe TYPE vgabe VALUE '2'. " Transaction Type
I N T E R N A L T A B L E S D E C L A R A T I O N S
DATA: i_po TYPE STANDARD TABLE OF s_po WITH HEADER LINE,
" Purchase Order
i_inv TYPE STANDARD TABLE OF s_inv_sum WITH HEADER LINE,
" PO Invoice Values
i_rep TYPE STANDARD TABLE OF s_rep WITH HEADER LINE,
" PO Invoice Values
i_ekbe TYPE STANDARD TABLE OF s_account WITH HEADER LINE.
" PO Invoice Values
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr MATCHCODE OBJECT kred,
s_ebeln FOR ekko-ebeln MATCHCODE OBJECT mekk,
s_bsart FOR t161-bsart,
s_ekgrp FOR t024-ekgrp,
s_bedat FOR ekko-bedat.
SELECTION-SCREEN END OF BLOCK b1.
I N I T I A L I Z A T I O N *
INITIALIZATION.
A T S E L E C T I O N - S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_screen.
S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P - O F - P A G E *
TOP-OF-PAGE.
Header of the List
PERFORM header.
E N D - O F - P A G E *
Footer
END-OF-PAGE.
ULINE.
E N D - O F - S E L E C T I O N *
END-OF-SELECTION.
Display the Report Output data
PERFORM display_data.
At Line-Selection
AT LINE-SELECTION.
When double clicked on EBELN display the details of Purchase Doc
PERFORM line_sel.
*& Form validate_screen
Validation of Selection Screen fields
FORM validate_screen .
Validation of Vendor Number
CLEAR lfa1-lifnr.
IF NOT s_lifnr[] IS INITIAL.
SELECT lifnr UP TO 1 ROWS
INTO lfa1-lifnr
FROM lfa1
WHERE lifnr IN s_lifnr.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Vendor'(002).
ENDIF.
ENDIF.
Validation of PO Number
CLEAR ekko-ebeln.
IF NOT s_ebeln[] IS INITIAL.
SELECT ebeln UP TO 1 ROWS
INTO ekko-ebeln
FROM ekko
WHERE ebeln IN s_ebeln.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Document Number'(003).
ENDIF.
ENDIF.
Validation of PO Document Type
CLEAR t161-bsart.
IF NOT s_bsart[] IS INITIAL.
SELECT bsart UP TO 1 ROWS
INTO t161-bsart
FROM t161
WHERE bsart IN s_bsart.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Purchase Document Type'(004).
ENDIF.
ENDIF.
Validation of Purchasing Group
CLEAR t024-ekgrp.
IF NOT s_ekgrp[] IS INITIAL.
SELECT ekgrp UP TO 1 ROWS
INTO t024-ekgrp
FROM t024
WHERE ekgrp IN s_ekgrp.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Purchasing Group'(005).
ENDIF.
ENDIF.
ENDFORM. " validate_screen
*& Form fetch_data
Fetching the PO related data from Database Tables
FORM fetch_data .
CLEAR i_po.
REFRESH i_po.
SELECT a~ebeln " PO No.
b~ebelp " PO Item
a~bstyp " PO Category
a~bukrs " Company Code
a~bsart " PO Type
a~lifnr " Vendor No
a~ekgrp " Purchase Group
a~waers " Currency
a~bedat " PO Date
b~txz01 " Material Text
b~werks " Plant
b~lgort " Storage Location
b~matkl " Material Group
b~menge " PR Quantity
b~meins " UOM
b~bprme " Price Unit
b~netpr " Net price
b~peinh " Price Unit UOM
b~pstyp " Item Category
b~knttp " Account Assignment Category
INTO TABLE i_po
FROM ekko AS a JOIN ekpo AS b
ON a~ebeln = b~ebeln
WHERE a~ebeln IN s_ebeln AND
a~lifnr IN s_lifnr AND
a~ekgrp IN s_ekgrp AND
a~bsart IN s_bsart AND
a~bedat IN s_bedat.
SORT i_po BY ebeln ebelp.
break-point.
IF NOT i_po[] IS INITIAL.
Fetch the PO History/Invoice Details from EKBE Table
CLEAR i_ekbe.
REFRESH i_ekbe.
SELECT ebeln " PO No.
ebelp " PO Item
gjahr " Fiscal Year
belnr " PO Invoice No
menge " PR Quantity
wrbtr " Price in Local Currency
dmbtr " Price in Foreign Currency
waers " Currency
shkzg " Dr/Cr Indicator
INTO TABLE i_ekbe
FROM ekbe
FOR ALL ENTRIES IN i_po
WHERE ebeln = i_po-ebeln AND
ebelp = i_po-ebelp AND
vgabe = c_vgabe.
break-point.
IF sy-subrc = 0.
SORT i_ekbe BY ebeln ebelp.
LOOP AT i_ekbe.
IF i_ekbe-shkzg = c_h.
i_ekbe-wrbtr = i_ekbe-wrbtr * -1.
ENDIF.
MODIFY i_ekbe.
ENDLOOP.
break-point.
Sum up the Item wise Invoice totals
LOOP AT i_ekbe.
AT END OF ebelp.
READ TABLE i_ekbe INDEX sy-tabix.
SUM.
MOVE-CORRESPONDING i_ekbe TO i_inv.
APPEND i_inv.
ENDAT.
CLEAR i_inv.
ENDLOOP.
SORT i_inv BY ebeln ebelp.
break-point.
ENDIF.
ENDIF.
Move the Vendor Name and Invoice Values to I_rep Internal Table
LOOP AT i_po.
MOVE-CORRESPONDING i_po TO i_rep.
CLEAR i_inv.
READ TABLE i_inv WITH KEY ebeln = i_po-ebeln
ebelp = i_po-ebelp.
IF sy-subrc = 0.
i_rep-orewr = ( i_po-menge - i_inv-menge ) * i_po-netpr.
i_rep-curr = i_inv-waers.
ELSE.
i_rep-orewr = i_po-menge * i_po-netpr.
i_rep-curr = i_po-waers.
ENDIF.
break-point.
Get the Vendor Name
CLEAR lfa1-name1.
SELECT SINGLE name1 FROM lfa1 INTO lfa1-name1
WHERE lifnr = i_po-lifnr.
IF sy-subrc = 0.
i_rep-name1 = lfa1-name1.
ENDIF.
APPEND i_rep.
CLEAR i_rep.
break-point.
ENDLOOP.
SORT i_rep BY lifnr ebeln ebelp.
DELETE i_rep WHERE orewr LE 0.
break-point.
ENDFORM. " fetch_data
*& Form display_data
Display the Report Output data
FORM display_data .
DATA: lv_flag, " New Flag
lv_rec TYPE i. " No of Records
CLEAR lv_rec.
IF i_rep[] IS INITIAL.
MESSAGE e000 WITH 'No Data found'(022).
ELSE.
LOOP AT i_rep.
Toggle Color
PERFORM toggle_color.
IF lv_flag <> space.
NEW-LINE.
ENDIF.
At New Purchase Document
AT NEW ebeln.
WRITE:/1 sy-vline, 2(10) i_rep-ebeln INTENSIFIED OFF.
lv_flag = c_x.
lv_rec = lv_rec + 1.
ENDAT.
WRITE: 1 sy-vline,
12 sy-vline,13(4) i_rep-bsart,
17 sy-vline,18(10) i_rep-lifnr,
28 sy-vline,29(35) i_rep-name1,
64 sy-vline,65(4) i_rep-ekgrp,
69 sy-vline,70(10) i_rep-bedat,
80 sy-vline,81(5) i_rep-ebelp,
86 sy-vline,87(40) i_rep-txz01,
127 sy-vline,128(9) i_rep-matkl,
137 sy-vline,138(1) i_rep-pstyp,
139 sy-vline,140(1) i_rep-knttp,
141 sy-vline,142(4) i_rep-werks,
146 sy-vline,147(4) i_rep-lgort,
151 sy-vline,152(13) i_rep-menge UNIT i_rep-meins,
165 sy-vline,166(3) i_rep-meins,
169 sy-vline,170(15) i_rep-netpr CURRENCY i_rep-waers,
185 sy-vline,186(4) i_rep-waers,
190 sy-vline,191(5) i_rep-peinh,
196 sy-vline,197(4) i_rep-bprme,
201 sy-vline,202(15) i_rep-orewr CURRENCY i_rep-curr,
217 sy-vline,218(4) i_rep-curr,
222 sy-vline,223(7) i_rep-bstyp centered,
230 sy-vline.
NEW-LINE.
hide: i_rep-ebeln.
ENDLOOP.
ULINE.
FORMAT COLOR OFF.
WRITE : /2 'Total Number of Purchasing Documents:'(025) COLOR 3,
lv_rec COLOR 3.
ENDIF.
ENDFORM. " display_data
*& Form header
Write the Report Header
FORM header .
FORMAT RESET.
header
WRITE:/1(230) 'LIST OF PURCHASE DOCUMENTS PER VENDOR'(006) CENTERED.
SKIP.
FORMAT COLOR COL_HEADING.
ULINE.
WRITE:/1 sy-vline,2(10) 'Pur.Doc.No'(006) CENTERED,
12 sy-vline,13(4) 'Type'(007),
17 sy-vline,18(10) 'Vendor'(008) CENTERED,
28 sy-vline,29(35) 'Name'(009) CENTERED,
64 sy-vline,65(4) 'PGrp'(010) CENTERED,
69 sy-vline,70(10) 'Doc.Date'(012) CENTERED,
80 sy-vline,81(5) 'Item'(011),
86 sy-vline,87(40) 'Material Short Text'(024) CENTERED,
127 sy-vline,128(9) 'Mat.Group'(013),
137 sy-vline,138(1) 'I',
139 sy-vline,140(1) 'A',
141 sy-vline,142(4) 'Plnt'(014),
146 sy-vline,147(4) 'SLoc'(015),
151 sy-vline,152(13) 'Quantity'(016) CENTERED,
165 sy-vline,166(3) 'UoM'(017),
169 sy-vline,170(15) 'Net Value'(018) CENTERED,
185 sy-vline,186(4) 'Curr'(019),
190 sy-vline,191(5) 'Per'(020),
196 sy-vline,197(4) 'Unit'(021),
201 sy-vline,202(15) 'To be Invoiced'(023) CENTERED,
217 sy-vline,218(4) 'Curr'(019),
222 sy-vline,223(7) 'Doc.Cat'(026),
230 sy-vline.
ULINE.
ENDFORM. " header
*& Form toggle_color
This routine alters the color of the records in the list
FORM toggle_color.
IF gv_dial = space.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
gv_dial = c_x.
ELSE.
FORMAT COLOR 1 INTENSIFIED OFF.
CLEAR gv_dial.
ENDIF.
ENDFORM. " toggle_color
*& Form LINE_SEL
*When double clicked on EBELN field display the details of Purchase Doc
FORM line_sel.
CASE sy-lsind.
WHEN '1'.
DATA: lv_field(20),
lv_value(10),
lv_bstyp like i_rep-bstyp.
clear: lv_bstyp,lv_value, lv_field.
GET CURSOR FIELD lv_field VALUE lv_value.
IF lv_field = 'I_REP-EBELN'.
IF NOT lv_value IS INITIAL.
READ LINE sy-index FIELD VALUE i_rep-bstyp
INTO lv_bstyp.
READ CURRENT LINE FIELD VALUE i_rep-bstyp INTO lv_bstyp.
if lv_bstyp = 'F'.
SET PARAMETER ID 'BES' FIELD lv_value.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
elseif ( lv_bstyp = 'K' or lv_bstyp = 'L' ).
SET PARAMETER ID 'VRT' FIELD lv_value.
CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
elseif lv_bstyp = 'A'.
SET PARAMETER ID 'ANF' FIELD lv_value.
CALL TRANSACTION 'ME43' AND SKIP FIRST SCREEN.
endif.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. " line_sel
<b>Reward points for useful Answers</b>
Regards
Anji -
Trigger how to get new and old value for nested table column?
Hi,
I have created a nested table based on the following details:
CREATE TYPE typ_item AS OBJECT --create object
(prodid NUMBER(5),
price NUMBER(7,2) )
CREATE TYPE typ_item_nst -- define nested table type
AS TABLE OF typ_item
CREATE TABLE pOrder ( -- create database table
ordid NUMBER(5),
supplier NUMBER(5),
requester NUMBER(4),
ordered DATE,
items typ_item_nst)
NESTED TABLE items STORE AS item_stor_tab
INSERT INTO pOrder
VALUES (800, 80, 8000, sysdate,
typ_item_nst (typ_item (88, 888)));
Now I would like to create a trigger on table pOrder for after insert or update or delete
and I would like to track the new and old value for the columns inside nested table.
Can anybody direct me how to do it?
I would like to know the sytax for it like:
declare
x number;
begin
x := :new.nestedtablecolumn;--how to get the new and old value from nested table columns
end;
Hope my question is clear.
Thanks,
LavanHi,
Try like this:
CREATE OR REPLACE TRIGGER PORDER_I
BEFORE INSERT
ON PORDER
REFERENCING OLD AS old NEW AS new
FOR EACH ROW
DECLARE
items_new typ_item_nst;
ordid_NEW NUMBER;
BEGIN
FOR i IN :new.items.FIRST .. :new.items.LAST LOOP -- For first to last element
DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').prodid: ' || :new.items(I).prodid );
DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').price: ' || :new.items(I).price );
END LOOP;
END;Regards,
Peter -
Multiple columns and rows in MessageService
I am attempting to create a message (via MessageService) which has multiple lines of data, and each line has multiple data columns.
Background: My program reads data from a web store, and creates Sales Orders in SBO. A single run might process multiple orders. When all orders have been entered, the program should send a (single) message to a list of recipients. The message will have one line of data for each sales order produced. Each line will contain two fields: the linked SBO sales order number, and the unlinked web order number.
When the message is initially created, I'm defining the multiple columns and initializing the data lines:
pMessageDataColumns = oMessage.MessageDataColumns
pMessageDataColumn = pMessageDataColumns.Add()
pMessageDataColumn.ColumnName = "SalesOrder"
pMessageDataColumn.Link = BoYesNoEnum.tYES
pMessageDataColumn = pMessageDataColumns.Add()
pMessageDataColumn.ColumnName = "WebOrder"
pMessageDataColumn.Link = BoYesNoEnum.tNO
oLines = pMessageDataColumn.MessageDataLines()
Later, as each Sales Order is processed, I'm attempting to inject the two data values into the message data:
oLine = oLines.Add()
oLine.Value = Str(pOrd.DocNum)
oLine.Object = 17
oLine.ObjectKey = Str(pOrd.DocEntry)
oLine = oLines.Add()
oLine.Value = pOrd.WebOrder
The above code would be invoked for each Sales Order processed. However, it generates an "Internal error (-5002) occurred" when the message is ultimately sent.
The SDK documentation states:
The MessageDataLine is a child data structure related to the MessageDataColumn. It contains the value of a specified cell in the Data table, which is defined by its column number (vtIndex of Item of MessageDataColumns) and row number (vtIndex of Item of MessageDataLines).
I guess I don't understand the relationship between adding a "line" in my data display versus adding data into a "column". It appears that the "oLines.Add()" is used to bump across the columns of the data. If so, how do I advance to the next entire row of data in the message?
Thanks, DaveClass Item
Public ItemCode As String
Public Dscription As String
End Class
Dim ItemCodes as new list( of item)
Dim one as new item
one.ItemCode = "ItemCode"
one. Dscription ="Name of Item"
itemcodes.add (one)
Try
Dim oCmpSvc As SAPbobsCOM.CompanyService = _ocmp.GetCompanyService()
Dim oMsgSvc As SAPbobsCOM.MessagesService = oCmpSvc.GetBusinessService(ServiceTypes.MessagesService)
Dim oMsg As SAPbobsCOM.Message = oMsgSvc.GetDataInterface(MessagesServiceDataInterfaces.msdiMessage)
oMsg.Subject = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
oMsg.Text = Msg
Dim oMsgDataColumn As SAPbobsCOM.MessageDataColumn
If ItemCodes.Count > 0 Then
oMsgDataColumn = oMsg.MessageDataColumns.Add()
oMsgDataColumn.ColumnName = "Product / Item Code"
oMsgDataColumn.Link = BoYesNoEnum.tYES
For Each oneitem As Item In ItemCodes
Dim oMsgDataLine As SAPbobsCOM.MessageDataLine = oMsgDataColumn.MessageDataLines.Add()
oMsgDataLine.Object = "4"
oMsgDataLine.ObjectKey = oneitem.ItemCode
oMsgDataLine.Value = oneitem.Dscription
Next
oMsgDataColumn = oMsg.MessageDataColumns.Add()
oMsgDataColumn.ColumnName = "Description"
oMsgDataColumn.Link = BoYesNoEnum.tNO
For Each oneitem As Item In ItemCodes
Dim oMsgDataLine As SAPbobsCOM.MessageDataLine = oMsgDataColumn.MessageDataLines.Add()
oMsgDataLine.Value = oneitem.Dscription
Next
End If
Dim oMsgRecipient As SAPbobsCOM.Recipient = oMsg.RecipientCollection.Add()
oMsgRecipient.UserCode = "manager"
oMsgRecipient.SendInternal = BoYesNoEnum.tYES
oMsgRecipient.SendEmail = BoYesNoEnum.tNO
oMsgSvc.SendMessage(oMsg)
MsgBox("SAP B1 internal Message sent...")
Catch ex As Exception
MsgBox("Unable to send SAP B1 internal message. Error:" + ex.Message)
End Try
End Sub
Maybe you are looking for
-
ITunes 7.1 won't start, invalid Win32 application error message comes up
I repeatedly tried to download iTunes 7.1 for my new iPod nano on my Windows XP, when the download completes and I try to run the program an error message comes up stating that iTunesupdate.exe is not a valid Win32 application...I have tried erasing
-
Any way to avoid Slow download of apps on ipad2
Really sick of this slow download of apps and YouTube streaming on iPad 2. It's blazing fast on my android phone at least 50 times faster with same connections.
-
Problem creating array... help!!!
Hi everyone, Im currently trying to do a project and I am a little suck. Could anyone please help? I have two classes. The first class is Ticket, which is an int array of 6, the other class is called TicketArray, which is an array of objetcs tickets.
-
Imac 27inch is a better option for editing?
Hi! i am having intel based Imac 17 inch computer .I want to go for 27inch . Is that good for editing? The imac 27inch has only one firewire 800 and i want to connect to my external hardrive and to my external monitor. So i need two firewire ports at
-
My quicktime screen recorder doesnt work
Hello My Quicktime Screen recorder doesn't work. What i mean is when i open quicktime and click file and click new screen recorder nothing shows up. Can you please fix this for me. Thanks