How to code header and items in internal table
Hi all,
Iam new to abap.
I have to write a report in internal table , for 1 header item related child items must exist,suppose if header is org then the child like branches in diff cities must be printed under that org and other org ther related branches etc.
can u tell me how i have to approach this with code.
Thanx.
Hi MJN,
U can either declare one internal table to hold the header & item data or u can declare two separate interal tables for each one of it.
Suppose i take only one internal table.
First declare a structure with all the relevant fields of the ORG & Branches then create an internal table for it.
Code:
TYPES:
Begin of t_struct,
org_field1 type <datatype> or <dataobj>,
org_field2 type <datatype> or <dataobj>,
branch_field1 type <datatype> or <dataobj>,
branch_field2 type <datatype> or <dataobj>,
END of t_struct.
Data:
t_data like table of t_struct with header line.
select <fields declared in struct> from ORG Inner Join Branch ON <org_field> = <branch_field>
where <some condition> into table t_data.
if sy-subrc <> 0.
message 'No Records Found:" type 'E'.
endif.
endselect.
Loop at t_data into t_data.
at new <org_field1>
write: org_field.
endat.
write: branch_field1, branch_field2.
endloop.
This shall solve the issue.
Thanks
Ravi
Similar Messages
-
How to get header and item data in ME_PROCESS_PO_CUST ?
Hi all,
How can I get header and item data in me_process_po_cust~process_account ? I have to do some validation for account assignment catagory in item overview.Hi ,,
Further make the following changes in method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM.
Get Line item data using method:
CALL METHOD IM_ITEM->GET_DATA
RECEIVING
RE_DATA = W_ITM_DATA.
and then validate the item data from structure W_ITM_DATA..
Same as follows for Header Records:
In method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_Header.
Thanks
Shambhu -
How to get header and item data.
Hi All,
I want to take for each FG material how much RAW material consum for that perticular FG material.
for eg.
for this fg mat 20000881 200.00 qty
raw material used for this 40000334 50.00
40000335 100.00
40000336 50.00
so how i can take in internal table and how do i link them.
thanks,
ashish.create an internal table it_fin with FG material and qty.
Then use avalable data as follows
" fg is the variable of type wa-fg.
" qty is the variable of type wa-qty
loop at itab into wa.
if wa-fg eq fg.
qty = qty + wa-qty.
else.
wa_fin-mat = wa-mat.
wa_fin-fg = wa-fg.
wa_fin-qty = qty.
append wa_fin into it_fin.
clear: qty,fg.
endif
fg = wa-fg.
endloop.
Regards,
Lalit Mohan Gupta -
Hi all,
How to link Header and Item details
RanjithHi,
The Line item table always have the header tables key as one of the key field. so u can use it.
for eg : VBAK-vbeln and VBAP-vbeln
Vbeln is the link between sales header and item table.
Hope this helps. -
BAPI_SALESORDER_CREATEFROMDAT2, Header and Item Level Ship-to
I have a situation where I want to have different header and item level ship-to accounts on a sales order. When I use the BAPI_SALESORDER_CREATEFROMDAT2 to create the order by passing the Ship-to for header and Item in order_partners table, the header ship-to is not updated.
This works fine if the header and item level ship-to are same.
Any ideas.Hi Amit,
put a breakpoint at the BAPI and check your PARTNERS table
e.g. in the case, i am using iterms partner for line 10 & 20 that is different to the header table (000000)
PARTN_ROLE PARTN_NUMB ITM_NUMBER TITLE NAME
1 AG |EDICUS |000000 | | <
2 WE |DODGE |000000 | | <
3 WE |EDICUS |000010 | | <
4 WE |RWCUS |000020 | | <
if your table is not like this , it won't work
otherwise, post the relevant code and we can check
kind regards
Paul Quinn -
How to create a new field for Q3 - QM notification in Header and item level
Dear All,
l
Sub: How to create a new field for Q3 - QM notification in Header and item level
Ref. the link --> Quality Notification
We want to create a new field in header level and item level.
As per the thread the solution is given below.
In the IMG Config: Quality Management -> Quality Notification -> Notification Types -> Define screen areas for notification types Then Choose 'Define screen areas' Then Click on 'New entries' button Now, select the relevant Notification Type and click in 'Enter'. Select the 'Iten Cases' register and remember to setup the Tabstrip Header, Icon, etc. Set the 'Tabstrip active' flag. Then Save.
Quality Notification -> Notification Types -> Define screen areas for notification types
WE ARE UNABLE TO FIND IN CUSTOMIZATION PATH --> DEFINE SCREEN AREAS FOR NOTIFICATION TYPES.
Please help.
Question No. 2 :
THE REQUIREMENT IS GIVEN BELOW.
We want to hide the field in Q3 - QM Notification
In header --> Reference tab --> Item (sub heading) --> "DEFECT LOCATION" FIELD TO BE ELIMINATED (HIDE)
Ref the link --> Quality notification
The solutiion is given below.
Hi Sami,
We can hide the collumns using the Transaction OQM1 and Program Name SAPLIQS0.
Lets say Defect location need to be hidden, the field TXTCDOT need to have the radio button HIDE.
Hope this will suffice your requirement.
Kindly ask me if you need any other details.
Thanks & Regards,
Srinivas.D
Hi Sami,
We can hide the collumns using the Transaction OQM1 and Program Name SAPLIQS0.
Lets say Defect location need to be hidden, the field TXTCDOT need to have the radio button HIDE.
Hope this will suffice your requirement.
Kindly ask me if you need any other details.
Thanks & Regards,
Srinivas.D
By double clicking the "DEFECTIVE QUANTITY (EXTERNAL), WE COULD NOT GET --> field TXTCDOT .
Plese do the needful.
We are using ECC6.0 Ehp3 and Ehp4.
With Best Regards,
Raghu SharmaDear Pushpa,
Transaction Code :SHD0 is working fine.
Please accept my sincere thanks for your sharing your Knowledge.
I am able to fulfill my
Regarding the enhancement, I have not tried.
Once I will complete, I will award the fulll marks to you.
With Best Regards,
Raghu Sharma -
How to upload header and corresponding item details to application server?
Hi all,
How to upload control data , header data and the corresponding data in the application server based on the company code.
If the user selects multiple company codes like US, GE,IN....3 files need to placed in the application server with the corresponding header and item details. The control data is unique per file.
Thanks,
CharanFor Header and Item data you create separate structure as below...
Header
|----Link
|----
|----
!-----Item
|-----link
|-------
(Note the hierarchy- Header str>LINK--> Its fields->ITEM str > LINK under ITEM str->ITEM's fields under ITEM's fields.)
Header part will have all header fields. Item will come under Header and all ITEM's fields will come under Item.
Both HEADER and ITEM will have field LINK -- Char 003 which will allow all ITEMs for a HEADER to fall under proper Header data..
Header and Item Structure will have different files as per the sequence of the fileds..
Map the fields properly..
It will work...
If its helpful to you don't forget to reward the pts..
Edited by: sumesh on May 19, 2008 4:28 PM -
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 -
How can we revise the pricing both at header and item level of sales order?
Dear All,
Now there's one issue of the pricing to me. i want to revise the pricing both at header and item level of sales order. but after i finished the cutomize and tested it, it's more different as i thought. i found that the pricing can revise at the one side only,for example, if i revise the pricing at item level and it's grey and can't be revised at the header. on the other hand, it's the same result what's happened at item.
So, in my opinion, we can't revise the pricing both at header and item, right? if not, please give me more advices and teach me how to solve the problem. thanks a lot.Dear Lakshmipathi,
Thanks a lot for your kindly and useful answer for me and I learn more for the pricing technology.
I didn't notice the way that you reminded ago therefore I also saw the button at the condition tab. And your suggestion makes me know more.
And I had tested the way that you said, I met with a question. Below is my opinion for my testing.
I had created one SO and the pricing was $10, then I revised the pricing from 10 to 15 by VK11. It can't be updated automatically at SO and I must update it manually by clicking the "Update" button. This is OK for my testing, but I have another question to disturb you for the use of "Active" button. When I click the button and nothing is responsed, it's quite different what you said. So, please give more detail for the Active button. Thanks a lot. -
In LSMW using BAPI Scenario, how to assign the same file to HEADER and ITEM
Hi,
i got a problem when we are in ASSIGN FILES step how to assign the same file to both HEADER and ITEM Structures?Hi,
When defining the file in specify files step check the option 'Data for Multiple Source Structures'.
Hope it helps.
Thanks,
Mahesh -
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. -
How to find the header and item level status of a CRM contract ?
Hi,
Few questions
A. How to find the header and item level status of a CRM contract ? My req is to select all the contract line items which are in CLOSED status.
B. How to get the BPs associated with a contract ?
Anyone have the list of CRM tables and the relation amongst them. Please mail me in [email protected]CRMD_ORDERADM_H Contains the Header Information for a Business Transaction.
Note:
1. It doesnt store the Business Partner
responsible for the transaction. To
get the Partner No, link it with
CRM_ORDER_INDEX.
2. This table can be used for search
based on the Object Id(Business
Transaction No).
CRMD_CUSTOMER_H Additional Site Details at the Header Level of a Business Transaction
CRMD_LINK Transaction GUID set for all the Business Transactions
CRMD_ORDER_INDEX Contains Header as well as Item details for a Business Transaction.
Note:
1. It doesnt store the Business
Transaction No (Object ID).
To get the Business Transaction No
link the table with
CRMD_ORDERADM_H
2. This table can be used for search
based on the Partner No
CRMD_ORDERADM_I Stores the Item information for a Business Transaction. The scenarios where we have a Contract Header and within contract we have Line Items for the contract, this table can be useful.
E.g. Service Contracts
CRMD_CUSTOMER_I Additional Site Details at the Item Level of a Service Contract
Pl.reward points....... -
How to upload the Header and Item texts
Hi ,
I need to upload the Header and Item texts , what is the process to upload.................................
Regards,
Raghunath.Shi,
see the sample code.
report ZVENDOR_BANK
no standard page heading line-size 255.
*-----tables declaration
tables:lfa1,lfbk,t100.
*-----data declaration
data:begin of it_dummy occurs 0,
dummy(100) type c,
end of it_dummy.
data:begin of it_lfa1 occurs 0,
lifnr like lfa1-lifnr,
ktokk like lfa1-lifnr,
name1 like lfa1-name1,
sortl like lfa1-sortl,
land1 like lfa1-land1,
end of it_lfa1,
begin of it_lfbk occurs 0,
lifnr like lfbk-lifnr,
banks like lfbk-banks,
bankl like lfbk-bankl,
bankn like lfbk-bankn,
koinh like lfbk-koinh,
end of it_lfbk.
data:bdcdata like bdcdata occurs 0 with header line.
start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\Rvelagapudi\Desktop\vendor.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = '#'
TABLES
DATA_TAB = it_dummy
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
loop at it_dummy.
if it_dummy-dummy+0(1) = 'H'.
it_lfa1-lifnr = it_dummy-dummy+1(4).
it_lfa1-ktokk = it_dummy-dummy+5(4).
it_lfa1-name1 = it_dummy-dummy+9(7).
it_lfa1-sortl = it_dummy-dummy+16(2).
it_lfa1-land1 = it_dummy-dummy+18(2).
append it_lfa1.
else.
it_lfbk-lifnr = it_dummy-dummy+1(4).
it_lfbk-banks = it_dummy-dummy+5(2).
it_lfbk-bankl = it_dummy-dummy+7(8).
it_lfbk-bankn = it_dummy-dummy+15(8).
it_lfbk-koinh = it_dummy-dummy+23(4).
append it_lfbk.
endif.
endloop.
loop at it_lfa1.
refresh bdcdata.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
it_lfa1-lifnr.
perform bdc_field using 'RF02K-KTOKK'
it_lfa1-ktokk.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-LAND1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
it_lfa1-name1.
perform bdc_field using 'LFA1-SORTL'
it_lfa1-sortl.
perform bdc_field using 'LFA1-LAND1'
it_lfa1-land1.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-KOINH(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
data:FNAM(20) TYPE C,
IDX TYPE C.
move 1 to idx.
LOOP AT IT_lfbk WHERE LIFNR = IT_lfa1-LIFNR.
CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
it_lfbk-banks.
CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
it_lfbk-bankl.
CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
it_lfbk-bankn.
CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
it_lfbk-koinh.
IDX = IDX + 1.
endloop.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
call transaction 'XK01' using bdcdata mode 'A'.
endloop.
Start new screen *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "BDC_DYNPRO
Insert field *
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM. "BDC_FIELD -
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,
BabuHi 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.
Maybe you are looking for
-
Extract Process creating a lot of database sessions on Source Database
Hi We have a GoldenGate installation with 9 extracts ( and 9 pumps ). With all GG processes ( inc MGR) down then there are 25 sessions on the source database, ( as goldengate user ), and when we start all processes there are 358 sessions in the datab
-
I have a Satellite E205. Can somebody PLEASE tell me how to keep the optical drive turned on? It turns itself off when I run the computer on battery and the only way to turn it back on is to wait for the computer to ask me if I want to turn the opt
-
IPhone - Trying to Update View from Separate Thread
I am having trouble updating a view. My iPhone project is built from the Utility Application template. Upon startup, the Main View is loaded and some network communications are performed (on a separate thread). In response to the reply from the netwo
-
Downloading photos OFF my ipod or Apple TV
I have a question that might seem a little odd. I was trying to install windows on my mac earlier this week. To make a long story short all my data was erased, including my photos. BUT, I still have all of my photos on my iPod and my Apple TV. I want
-
Recording streaming audio question
Sorry if I have the wrong forum. Is there any Apple applications you can use to record a streaming radio station (i.e. say a football game).....Thanks