Loop through header and item internal table
Hi,
My scenario will be like this, i have two internal tables which is populated based on certain conditions, now i have to call one bapi to update values that am going to store values in a tree structure say for eg mat01 is header and mat02 and mat03 are item values.
What is the efficient method to call that bapi one time for header creation and consequte times for item creation respectively.
shall i have to loop thro two internal tables i.e header and item?
suggestions are welcomed from the experts...
Thanks in advance...
Regards,
Babu
Hi Babu
you can do something like that.
loop it_header.
*Call bapi to create header
loop it_item where field_key = it_header-field_key.
* Call bapi to create item
endloop.
endloop.
The important part is the where sentence in the second loop.
Regards
David N.
Similar Messages
-
Display constant values in header and items from table in ALV
Hello all,
I have to dispaly the header and Item entires in the output . and the point is header values are all constant and they are not related to item data . item data is to dispalyed from VBAP table .
so how can i achive this .. can i use this FM REUSE_ALV_HIERSEQ_LIST_DISPLAY ...
example of outpput..
Header inforamtions..
name city areacode areazone postzip
abcde xyz 1244 abc 123456
and the item details should be right below the header details
Cnt Vbeln vkorg vtweg matnr etc etc
1 xxx xx xx xxxx xxx xxxx
2 xxx xx xx xxxx xxx xxxx
3 xxx xx xx xxxx xxx xxxx
4 xxx xx xx xxxx xxx xxxx
5 xxx xx xx xxxx xxx xxxx
6 xxx xx xx xxxx xxx xxxx
I am able to dispaly the line items with the FM 'REUSE_ALV_GRID_DISPLAY' plz advice the best solution to achive this
thanks
Raj
Edited by: abaprthree on Oct 28, 2009 12:30 PMHi,
For this you will need to define header for the ALV. Here is a simple example how to do this:
First you need to write one Header form like following:
FORM f004_header USING it_head TYPE slis_t_listheader..
DATA : wa_line TYPE slis_listheader.
CLEAR wa_line.
wa_line-typ = 'H'. " H = Header, S = Selection, A = Action
wa_line-info = 'List of Sales Orders'.
APPEND wa_line TO it_head.
" Here type out all the required data one by one in work are and append it to internal table
ENDFORM. "f004_header
before calling REUSE_ALV_GRID_DISPLAY you need to call following
TO HEADER EVENT
FORM f006_top.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_header.
ENDFORM.
and for REUSE_ALV_GRID_DISPLAY call as following
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'F006_TOP'
it_fieldcat = t_fieldcatalog[]
TABLES
t_outtab = it_data.
Let me know if any other help is needed. -
Difference between header and item table
hi experts
I have doubt in choosing header and item table. what is the difference between them. on what situations they can be choosed, how can i conclude that my object needs only item or header table.
thanks in advance.
maayaHi
Header will be always a single time data in a transaction
where as Item data is Multiple lines of data
Item data in most of the times consists of more number of lines.
see the header and Item related tables for some Tcodes
Tcode Header Item
VA01 VBAK VBAP Sales order
VL01N LIKP LIPS Delivery
VF01 VBRk VBRP Invoice/Billing Doc
ME21N EKKO EKPO Pur order
Regards
Anji -
Header and Item Odata through SEGW
Hi,
I know that this Topic was raised million times, but still raising this query. I have already consulted http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0d92637-3d0d-2f10-ebb2-efc1f40a85e8?QuickLink=index&… link.
Requirement: Create Header and Item Odata THROUGH SEGW.
Steps I have followed:
1. Created Header and Item Structure and have added them in the Export Parameters of an RFC.
2. Created the RFC and have populated the the internal tables corresponding to the Header and Item structures.
3. Go to Transaction SEGW and Imported the Header from the RFC. Then created Read and Query mapping for Header.
4. Go to Transaction SEGW and Imported the Item from the RFC. Then created Read and Query mapping for Item.
5. Created an association between "ID" of Header with "ID" of Item. Cardinality- 1:N
Observation:
Now when I run the Odata and execute /sap/opu/odata/sap/ZTEST_SRV/HDRSet(2)/ITEMSet, I get all the Items from the Item table for Each and every Header. But I guess for every header corresponding Items should have been enlisted.
Is there any step that I am missing?
Important: In the MPC class(ZCL_TEST_MPC), I could see a method named DEFINE_ASSOCIATION. I have put an external Breakpoint in it, but this breakpoint is not triggered.
-Regards
DhrubajyotiHii Dhru,
In addition to the steps followed, you have to create navigation property using association created.
You have to implement Get_expand_entityset method in DPC method for multiple headers and corresponding items and for single header and corresponding items you have to implement GET_EXPANDENTITY method.
The URL is as format below :
/sap/opu/odata/sap/<service name>/<Header entity set>/?$expand=<navigation property from header to item>&$filter= eq '<ID>' '<value>'
Example URL : https://<server>:<port>/.../<service_name>/SalesOrders?$expand=SalesOrderItems
For reference :
https://help.sap.com/saphelp_gateway20sp08/helpdata/en/ca/c683e803494b77a2e1290b987556e2/content.htm
When GET_EXPANDED_ENTITYSET method invoked
For get_expanded_entity_set method implementation please refer the below URL
http://scn.sap.com/community/gateway/blog/2014/07/18/implementing-expand-entityentity-set
Regards,
Lokeswar Reddy byni. -
Header and Item table - Form Design Question
Hi All,
I have a header table and Item table. For every record in the header table I have multiple records in the item table. I want to have a adobe form in the following way
1. A new page starts for every record in the header table and Items in the item table for this header record can span multiple pages with the same header information.
2. When all the items are displayed for that particular header record, a new page should start for the next header record.
I created one internal table in the following way
Header_field1 Header_field2 Item_table(with all the items for this header record)
Header_field1 Header_field2 Item_table(with all the items for this header record)
I am not sure how to use a table for this scenario (Should It be a nested table?).
Please provide me some ideas.
Thanks,
Ganesh.Hi Balasubramani,
I made some changes and have the following now. Can you please let me know how I can achieve page break for every BP_NUMBER.
I have a nested table like the one below.
Main table u2013 Has header and Items information. Every header record has some header information like BP number, name and all line items for that BP in a nested table .
IT_HEADER:
BP_NUMBER BP_NAME IT_ITEMS(Items table)
BP_NUMBER BP_NAME IT_ITEMS
BP_NUMBER BP_NAME IT_ITEMS
To display this information I created the following
Subform1 u2013 overflow u2013bound to $record.IT_HEADER.DATA[*] u2013 (Repeat sub form for
| each data item)
|->Header sub form u2013 Positioned
| |
| |-> Text Field u2013 bound to BP_NUMBER
|
|
|->Item sub form -
|
|->Item Table u2013 bound to IT_ITEMS
|
|->Data u2013 bound to IT_ITEMS.DATA[*] u2013(Repeat row for each data item)
In the output BP number in the first record of IT_HEADER gets displayed and then all the Item records in IT_ITEMS for that BP get displayed. This is repeated all the records in IT_HEADER which is perfectly fine.
Please provide me some suggestions to solve the following issues I am having
1. I need a page break between records of IT_HEADER. I want the new subform1 for the next header record to start in a new page. I tried conditional break option, on the only field BP number in header sub form. I have two master pages and two body pages. All the above information is in master page 2 and body page 2. I am also not sure what to select in the TO section of the conditional break screen.
2. When there is an overflow in IT_ITEMS I need the Header sub form to be shown in the next page too.
Thanks,
Ganesh. -
What table stores delivery header and item texts?
Hi Gurus,
Which table stores header and item text of delivery? We use VBBP text object and provide test id, language to read the texts using function module 'READ_TEXT'.
Can you please tell me which table store the texts?
Best regards,
Pavan>
Pavan1 wrote:
> Hi Gurus,
>
> Which table stores header and item text of delivery? We use VBBP text object and provide test id, language to read the texts using function module 'READ_TEXT'.
>
> Can you please tell me which table store the texts?
>
> Best regards,
> Pavan
This stores in text objects so you need to pass
Here is simple thing to find what to pass to the read_text function module.
Go to delivery - If you want to find header text - GOTO (on application menu) - Header -texts - Double click on the text where you enter text - GOTO (on application menu) - Header - This will give you a popup kind of screen where you can find the
text name (if it is header - only delivery number and if it is item - deliverynumber + item number ) , lang, Text id, Text object
This will give you the required parameters... . -
Opportunity Header and Item tables
I am looking at the keys on the Opportunity Header and Item table which are GUIDs.
I have the following scenario.
1. My source table contains the Opportunity Header GUID
2. My target table requires all the fields from the source table and some Opportunity Header and Item attributes
I can write WHERE clause logic for my Opportunity Header attributes
For my Opportunity item attributes I was going to introduce a count - this is not possible with Item GUID unless a part of the GUID is incremental for each line by 1 or there is a maintained field otherwise as part of the Opportunity Item which is a number representation for each line.
Can someone advise
ThanksHi,
In the CRMD_ORDERADM_H table you have the Opportunity GUID as well as the Object ID which is the opportunity id. In the CRMD_ORDERADM_I table, you have the GUID and also the NUMBER_INT which is the item number. See if you can use the item number.
Thanks. -
Tables for Purchase Requistion Header and Item Texts
Hi,
In which Tables does Purchase Requistion Header and Item Texts will be stored.
Thanks in advanceNot sure , you can try with T166K , T166P
-
How to make pricing field as output only in sales order header and item lev
Hi ,
I want to make the field PRICING DATE as output only both at header and item level. How can i do pls guide me in detail.
Regards
SunainaHi Sunaina ,
Through User Exit you get this requirement plese take help of ABAPer to activate the user exit according to your requirement.
Try With this User Exit
Program MV45AFZZ
USEREXIT_FIELD_MODIFICATION
This user exit can be used to modify the attributes of the screen fields.
To do this, the screen fields are allocated to so-called modification groups 1 - 4 and can be edited together during a modification in ABAP. If a field has no field name, it cannot be allocated to a group.
The usage of the field groups (modification group 1-4) is as follows:
Modification group 1: Automatic modification with transaction MFAW
Modification group 2: It contains 'LOO' for step loop fields
Modification group 3: For modifications which depend on check tables or on other fixed information
Modification group 4: is not used
The FORM routine is called up for every field of a screen. If you require changes to be made, you must make them in this user exit.
This FORM routine is called up by the module FELDAUSWAHL.
See the Screen Painter manual for further information on structuring the interface.
I hope it will help you,
Regards,
Murali. -
Creation of Sorted and Standard and Hashed Internal Tables ..
Hi ..
Pls specify me.. how to create .. sorted ,Standard and Hashed Internal Tables...
pls give me the full code regarding ...this ..
ThnksStandard tables
This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.
Sorted tables
This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
Hashed tables
This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
Special Features of Standard Tables
Unlike sorted tables, hashed tables, and key access to internal tables, which were only introduced in Release 4.0, standard tables already existed several releases previously. Defining a line type, table type, and tables without a header line have only been possible since Release 3.0. For this reason, there are certain features of standard tables that still exist for compatibility reasons.
Standard Tables Before Release 3.0
Before Release 3.0, internal tables all had header lines and a flat-structured line type. There were no independent table types. You could only create a table object using the OCCURS addition in the DATA statement, followed by a declaration of a flat structure:
DATA: BEGIN OF <itab> OCCURS <n>,
<fi> ...
END OF <itab>.
This statement declared an internal table <itab> with the line type defined following the OCCURS addition. Furthermore, all internal tables had header lines.
The number <n> in the OCCURS addition had the same meaning as in the INITIAL SIZE addition from Release 4.0. Entering 0 had the same effect as omitting the INITIAL SIZE addition. In this case, the initial size of the table is determined by the system.
The above statement is still possible in Release 4.0, and has roughly the same function as the following statements:
TYPES: BEGIN OF <itab>,
<fi> ...,
END OF <itab>.
DATA <itab> TYPE STANDARD TABLE OF <itab>
WITH NON-UNIQUE DEFAULT KEY
INITIAL SIZE <n>
WITH HEADER LINE.
In the original statement, no independent data type <itab> is created. Instead, the line type only exists as an attribute of the data object <itab>.
Standard Tables From Release 3.0
Since Release 3.0, it has been possible to create table types using
TYPES <t> TYPE|LIKE <linetype> OCCURS <n>.
and table objects using
DATA <itab> TYPE|LIKE <linetype> OCCURS <n> WITH HEADER LINE.
The effect of the OCCURS addition is to construct a standard table with the data type <linetype>. The line type can be any data type. The number <n> in the OCCURS addition has the same meaning as before Release 3.0. Before Release 4.0, the key of an internal table was always the default key, that is, all non-numeric fields that were not themselves internal tables.
The above statements are still possible in Release 4.0, and have the same function as the following statements:
TYPES|DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
WITH NON-UNIQUE DEFAULT KEY
INITIAL SIZE <n>
WITH HEADER LINE.
They can also be replaced by the following statements:
Standard Tables From Release 4.0
When you create a standard table, you can use the following forms of the TYPES and DATA statements. The addition INITIAL SIZE is also possible in all of the statements. The addition WITH HEADER LINE is possible in the DATA statement.
Standard Table Types
Generic Standard Table Type:
TYPES <itab> TYPE|LIKE STANDARD TABLE OF <linetype>.
The table key is not defined.
Fully-Specified Standard Table Type:
TYPES <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
WITH NON-UNIQUE <key>.
The key of a fully-specified standard table is always non-unique.
Standard Table Objects
Short Forms of the DATA Statement :
DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>.
DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
WITH DEFAULT KEY.
Both of these DATA statements are automatically completed by the system as follows:
DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
WITH NON-UNIQUE DEFAULT KEY.
The purpose of the shortened forms of the DATA statement is to keep the declaration of standard tables, which are compatible with internal tables from previous releases, as simple as possible. When you declare a standard table with reference to the above type, the system automatically adopts the default key as the table key.
Fully-Specified Standard Tables:
DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
WITH NON-UNIQUE <key>.
The key of a standard table is always non-unique.
Internal table objects
Internal tables are dynamic variable data objects. Like all variables, you declare them using the DATA statement. You can also declare static internal tables in procedures using the STATICS statement, and static internal tables in classes using the CLASS-DATA statement. This description is restricted to the DATA statement. However, it applies equally to the STATICS and CLASS-DATA statements.
Reference to Declared Internal Table Types
Like all other data objects, you can declare internal table objects using the LIKE or TYPE addition of the DATA statement.
DATA <itab> TYPE <type>|LIKE <obj> WITH HEADER LINE.
Here, the LIKE addition refers to an existing table object in the same program. The TYPE addition can refer to an internal type in the program declared using the TYPES statement, or a table type in the ABAP Dictionary.
You must ensure that you only refer to tables that are fully typed. Referring to generic table types (ANY TABLE, INDEX TABLE) or not specifying the key fully is not allowed (for exceptions, refer to Special Features of Standard Tables).
The optional addition WITH HEADER line declares an extra data object with the same name and line type as the internal table. This data object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate this by placing brackets after the table name (<itab>[]). Otherwise, ABAP interprets the name as the name of the header line and not of the body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.
TYPES VECTOR TYPE SORTED TABLE OF I WITH UNIQUE KEY TABLE LINE.
DATA: ITAB TYPE VECTOR,
JTAB LIKE ITAB WITH HEADER LINE.
MOVE ITAB TO JTAB. <- Syntax error!
MOVE ITAB TO JTAB[].
The table object ITAB is created with reference to the table type VECTOR. The table object JTAB has the same data type as ITAB. JTAB also has a header line. In the first MOVE statement, JTAB addresses the header line. Since this has the data type I, and the table type of ITAB cannot be converted into an elementary type, the MOVE statement causes a syntax error. The second MOVE statement is correct, since both operands are table objects.
plz reward if useful -
Checkbox in header and item level records.
Hello Freinds,
I have a requirment in which I need to display checkboxes in front of header as well as item level records. I am trying to make a copy of standard transaction VL37. This transaction uses the REUSE_ALV_HIERSEQ_LIST_DISPLAY for displaying header and item level data. I debugged and found that in the alv layout there is a field with name box name. If we pass the name of header internal table to that field then we can get checkbox in front of header level records and if we pass item level internal table name then it shows the checkbox in front of item level records.
Can anyone provide some possibility of adding checkbox for both header and item level records while using the same ALV FM.Hello Harsh,
I am also kind of facing the same issue. I have used the FM REUSE_ALV_HIERSEQ_LIST_DISPLAY for ALV display. And I need to add checkbox at item level.
I have tried to add checkbox through field catalog. Following is the code I'm writing.
l_wa_fieldcat-fieldname = l_c_flag.
l_wa_fieldcat-tabname = l_c_item.
l_wa_fieldcat-checkbox = abap_true.
*l_wa_fieldcat-edit_mask = abap_f.
l_wa_fieldcat-edit = abap_true.
l_wa_fieldcat-key = abap_true.
l_wa_fieldcat-seltext_m = l_c_flag.
APPEND l_wa_fieldcat to em_it_fieldcat.
But in this case the checkbox appears in disabled form.
Can you please help? Could you be a bit elaborate on your answer i.e. the code snippet? Many thanks.
Regards,
Debapriya -
How can i create Header and items in SMART FORM
Hi Experts,
How can i create Header and items in SMART FORM in the below driver program.
_Header fields_
SELECT BUKRS BUDAT GJAHR CPUDT USNAM BLART BELNR XBLNR BLDAT WAERS KURSF
FROM BKPF INTO CORRESPONDING FIELDS OF TABLE IT_HEAD WHERE BELNR IN S_BELNR AND BUDAT IN S_BUDAT AND GJAHR EQ S_GJAHR AND BUKRS EQ S_BUKRS AND CPUDT IN S_CPUDT AND USNAM IN S_USNAM.
Item firlds
SELECT BUZEI BSCHL SGTXT SHKZG KOSTL PRCTR WERKS WRBTR HKONT KUNNR ZFBDT FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_ITEM
FOR ALL ENTRIES IN IT_HEAD WHERE BELNR = IT_HEAD-BELNR AND GJAHR = IT_HEAD-GJAHR AND BUKRS = IT_HEAD-BUKRS.
LOOP AT IT_HEAD.
MOVE-CORRESPONDING IT_HEAD TO FINAL.
LOOP AT IT_ITEM
WHERE BELNR = IT_HEAD-BELNR.
MOVE-CORRESPONDING IT_ITEM TO FINAL.
ENDLOOP.
ENDLOOP.
Regards,
Sreedhar.for these internal tables you can pass some Identifier for both tables.
in header file : IT_HEAD
IDENT type char10,
BUKRS type BUKRS,
BUDAT type BUDAT, like
in header file :IT_ITEM
IDENT type char10,
BUZEI type BUZEI,
BSCHL type BSCHL, like in item data
you need to fille the IDENT value like
IT_HEAD:
10 -- DE01-- 10.20.2009
20 -- CH01-- 10.20.2009
IT_ITEM
10 -- 1234-- KSCHL value like all records
10 -- 2345-- KSCHL value like all records
10 -- 6783-- KSCHL value like all records
20 -- 3452-- 1KSCHL value like all records
20 -- 4532-- KSCHL value like all records
20 -- 4535-- KSCHL value like all records
in smartform you need to create 2 tables.
or create
LOOP with IT_HEAD
table with IT_HEAD
table with IT_ITEM
and put the condition for each table in DATA tab where condtion like IDENT = IT_HEAD-IDENT
in item table also INDENT = IT_ITEM-INDENT.. -
How to header and item data of sales order using bapi interface
hi friends,
i am geetha, i having a problem like how to upload sales oder header and item data through va01 tcode using BAPI FUNCTION MODULES.
i need bapi function modules for header adn item data and brief explation on that , how to pass importing and tables parameters to get exact output .
regards
geetha.Use : BAPI_SALESORDER_CREATEFROMDAT2
Sales order: Create Sales Order
Functionality
You can use this method to create sales orders.
You must enter at least sales order header data (via ORDER_HEADER_IN structure) and partner data (via the ORDER_PARTNERS table) as input parameters.
Enter the item data via the ORDER_ITEMS_IN table. You can allocate item numbers manually, by filling in the relevant fields, or the system does it, according to the settings for Customizing, by leaving the relevant fields blank.
If you have configurable items, you must enter the configuration data in the ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_PART_OF and ORDER_CFGS_VALUE tables.
Credit cards can be transferred via the BAPICCARD structure, on the one hand, data for card identification, on the other, data for a transaction which has taken place in an external system.
Once you have created the sales order successfully, you will receive the document number (SALESDOCUMENT field). Any errors that may occur will be announced via the RETURN parameter.
If no sales area has been created in the sales order header, then the system creates the sales area from the sold-to party or ship-to party, who has been entered in the partner table. If a clear sales area cannot be created, you will receive a system message, and the sales order will not be created.
Notes
1. Mandatory entries:
ORDER_HEADER_IN : DOC_TYPE Sales document type
SALES_ORG Sales organization
DISTR_CHAN Distribution channel
DIVISION Division
ORDER_PARTNERS..: PARTN_ROLE Partner role, SP sold-to party
PARTN_NUMB Customer number
ORDER_ITEMS_IN..: MATERIAL Material number
2. Ship-to party:
If no ship-to party is entered, use the following: Ship-to party =
sold-to party.
3. Commit control:
The BAPI does not have a database commit. This means that the relevant application must leave the commit, in order that can be carried out on on the database. The BAPI BAPI_TRANSACTION_COMMIT is available for this.
4. German key words:
The following key words must be entered in German, independantly of
the logon language:
DOC_TYPE Sales document type, for example: TA for standard order
PARTN_ROLE Partner role, for example: WE for ship-to party
Further information
You can find further information in the OSS. The note 93091 contains general information on the BAPIs in SD.
Parameters
SALESDOCUMENTIN
ORDER_HEADER_IN
ORDER_HEADER_INX
SENDER
BINARY_RELATIONSHIPTYPE
INT_NUMBER_ASSIGNMENT
BEHAVE_WHEN_ERROR
LOGIC_SWITCH
TESTRUN
CONVERT
SALESDOCUMENT
RETURN
ORDER_ITEMS_IN
ORDER_ITEMS_INX
ORDER_PARTNERS
ORDER_SCHEDULES_IN
ORDER_SCHEDULES_INX
ORDER_CONDITIONS_IN
ORDER_CONDITIONS_INX
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
Exceptions
Function Group
2032 -
Header and Item data in a module pool
Hi Friends,
I designed a screen in that i have header data and item data.
Here in my screen header i have vendor number,Vendor name,
bank Name, Branch, LC value and Due date fields.
and for item details i have to take table control.In the item details i have the fields Sl No, PO Number and Po Value.
and Two push buttons i need to put.SAVE and CANCEL.
When i click on SAVE all my screen details should be saved in a ZTABLE and should generate a LCDOCUMENT-Number from the system.
So my question is shell i take the two tables for header and item data or one is enough and if i take two tables(one is header and one is item data) how i write the logic to store into the ztables.
How can i proceed.Plz provide me with ur inputs
Thanks and Regards.Hi!
you have to take one table.....in which u have to move the header and item data into that b'coz according to the header data the items are to be displayed.......
select the data for which ever tables they came and then take a final table in which include all the fields of header and item .loop on all the tables from which data u have taken and inside it move the data of those fields into the fields of the final table.
In the ALV u need to call the function module to display the ALV with that final table in which ur all data is there and prepare a field catalog of those fields you want to display in the item list.
for example a sample code is there...
types:
begin of type_s_vbak,
vkorg type vbak-vkorg, " Sales Organization
aufnr type vbak-aufnr, " Sales Order Number
auart type vbak-auart, " Sales Order Type
kunnr type vbak-kunnr, " Customer Number
vbeln type vbak-vbeln, " Sales Document
knumv type vbak-knumv, " Number of Document Condition
end of type_s_vbak. " BEGIN OF TYPE_S_VBAK
types:
begin of type_s_konv,
kwert type konv-kwert, " Condition Value
kbetr type konv-kbetr, " Rate (Condition Amount)
knumv type konv-knumv, " Number of Document Condition
kschl type konv-kschl, " Condition Type
end of type_s_konv. " BEGIN OF TYPE_S_KONV
types:
begin of type_s_material,
kunnr type vbak-kunnr, " Customer Number
matnr type vbap-matnr, " Material Number
arktx type vbap-arktx, " Material Description
steuc type marc-steuc, " Fiscal Classification
kwmeng type vbap-kwmeng, " Quantity
knumv type vbak-knumv, " Number of Document Condition
vbeln type vbak-vbeln, " Document Number
kwert type konv-kwert, " Condition Value
total type p length 14 decimals 2,
" Total
ipitype type p length 9 decimals 3,
" IPI Type
ipivalue type konv-kwert, " IPI Value
end of type_s_material. " BEGIN OF TYPE_S_MATERIAL
data:
fs_vbak type type_s_vbak.
data:
fs_mati type type_s_material.
data:
fs_konv type type_s_konv.
data:
t_vbak like
standard table
of fs_vbak.
data:
t_konv like
standard table
of fs_konv.
data:
t_mati like
standard table
of fs_mati.
loop at t_konv into fs_konv where kschl eq 'ZPNF'.
move fs_konv-kwert to fs_mati-kwert.
modify t_mati from fs_mati
transporting kwert
where knumv eq fs_konv-knumv.
endloop. " LOOP AT T_KONV INTO FS_KONV
* Modifying Total Field of Material Table.
loop at t_mati into fs_mati.
w_total = fs_mati-kwmeng * fs_mati-kwert.
move w_total to fs_mati-total.
modify t_mati from fs_mati
index sy-tabix
transporting total.
clear w_total.
endloop. " LOOP AT T_KONV INTO FS_KONV
* Modifying IPI-Type Field of Material Table.
loop at t_konv into fs_konv where kschl eq 'IPI3'.
w_total = fs_konv-kbetr div 10.
move w_total to fs_mati-ipitype.
modify t_mati from fs_mati
transporting ipitype
where knumv eq fs_konv-knumv.
clear w_total.
endloop. " LOOP AT T_KONV INTO FS_KONV
* Modifying IPI-Value Field of Material Table.
loop at t_konv into fs_konv where kschl eq 'IPI3'.
move fs_konv-kwert to fs_mati-ipivalue.
modify t_mati from fs_mati
transporting ipivalue
where knumv eq fs_konv-knumv.
endloop. " LOOP AT T_KONV INTO FS_KONV
and then fill the fieldcatalog and display the ALV
Edited by: Richa Tripathi on Apr 15, 2009 3:28 PM -
Hi,
What are all the tables from which the data would be taken to display in header and item data in process PO ? From where these data would be taken ?
Thanks alot.
Regards, Sunayana NADR10 Printer (Business Address Services)
ADR11 SSF (Business Address Services)
ADR12 FTP and URL (Business Address Services)
ADR13 Pager (Business Address Services)
ADR2 Telephone Numbers (Business Address Services)
ADR3 Fax Numbers (Business Address Services)
ADR4 Teletex Numbers (Business Address Services)
ADR5 Telex Numbers (Business Address Services)
ADR6 E-Mail Addresses (Business Address Services)
ADR7 Remote Mail Addresses (SAP - SAP - Communication; BAS)
ADR8 X.400 Numbers (Business Address Services)
ADR9 RFC Destinations (Business Address Services)
ADRCOMC Comm. Data Serial Number Counter (Business Address Services)
ADRCT Address Texts (Business Address Services)
ADRG Assignment of Addresses to Other Address Groups (BAS)
ADRGP Assignment of Persons to Further Person Groups (BAS)
ADRT Communication Data Text (Business Address Services)
ADRU Table for Communication Usages
ADRV Address Where-Used List (Business Address Services)
ADRVP Person Where-Used List (Business Address Services)
BBP_PDACC Account Assignment
BBP_PDATT Document Attachment
BBP_PDBEH Backend Specific Header Data
BBP_PDBEI Backend Specific Item Data
BBP_PDBGP Partner Extension Gen. Purchasing Data
BBP_PDBINREL Transaction Object Linkage (EBP)
BBP_PDCON Purchase Order Item Confirmation
BBP_PDHAD_V Business Transaction Versions
BBP_PDHCF Set for Tabular Customer and Solution Fields on Hdr
BBP_PDHGP Business Transaction Purchasing Information
BBP_PDHSC Header Extension for Customer Fields
BBP_PDHSS Hdr Extension for SAP Internal Enhancements (IBUs and so on)
BBP_PDIAD_V Business transaction item
BBP_PDICF Set for Tabluar Customer and Solution Fields on Itm
BBP_PDIGP Business Transaction Item-Purchasing Information
BBP_PDISC Item Extension for Customer Fields
BBP_PDISS Item Ext. for SAP Internal Enhancements (IBUs and so on)
BBP_PDLIM Value Limit
BBP_PDLINK_V Transaction - Set - Link
BBP_PDORG Purchasing Organizational Unit
BBP_PDPSET Further Procurement Information
BBP_PDTAX Tax
BBP_PDTOL Tolerances
CDCLS Cluster structure for change documents
CDHDR Change document header
CDPOS_STR Additional Change Document - Table for STRINGs
CDPOS_UID Additional Table for Inclusion of TABKEY>70 Characters
CRMD_LINK Transaction - Set - Link
CRMD_ORDERADM_HBusiness Transaction
CRMD_ORDERADM_IBusiness Transaction Item
CRMD_PARTNER Partners
CRM_JCDO Change Documents for Status Object (Table JSTO)
CRM_JCDS Change Documents for System/User Statuses (Table JEST)
CRM_JEST Individual Object Status
CRM_JSTO Status Object Information
SROBLROLB Persistent Roles of BOR Objects
SROBLROLC Persistent Roles of Business Classes
SRRELROLES Object Relationship Service: Roles
STXB SAPscript: Texts in non-SAPscript format
STXH STXD SAPscript text file header
STXL STXD SAPscript text file lines
TOA01 Link table 1
TOA02 Link table 2
TOA03 Link table 3
TOAHR Container table for HR administration level
TCURR- Exchange table
Maybe you are looking for
-
Creative Cloud Apps Download funktioniert nicht mehr
Hallo ich habe bei Creative Cloud Apps Download Probleme seit ich OSX Yosemite geladen habe. Ich habe schon alles probiert nix geht mehr. Bereits habe ich Java Version 8 installiert und auch die Creative Cloud neu installiert. Nichts hilft und der Su
-
Aperture 3.3 "import folders as projects" broken
Dear all, I am attempting to "import folders as projects" after upgrading from 3.2 to 3.3, and it breaks EVERYTIME. I am attempting to import from an external USB3 HDD which was formated for mac properly, and checked and rechecked using the disk mana
-
Relative function in FR reports
I want to use a function in FR reports equal to the @Relative function in Essbase NOT the Relative Function found in FR (as it seems to only work on SAP / SSAS database. Basically I want the user to select POV x and take all the Lvl 0 members under t
-
Hi guys, I've created an ADF UI for a HT using the add ADF taskflow based on human task method. From the generated data control I added on the taskdetails.jspx page the full task details (history, comments, attachments, payload, task actions etc.) -
-
When GOA goes to error in process status?
for example In purchase order, purchaser can change the plant at header or item level even follow-on document exists. The symptom can be reproduced by executing the following steps, 1. Create purchase order in extended classic scenario 2. Create part