Reg - Reading internal table with multiple record in a single field
Dear Guru's,
i want to read a internal table with field having mutilple entries like
read table READ TABLE LT_T2 INTO LT_T2_WA WITH KEY HKONT IN ( '0001152430', '0001152930', '0001152410' ).
But it says comma without preceding colon (after READ?).
please guide me.....
thanks & Regards,
Balaji.S
ya this is inside the loop.
plz check....
loop at lt_t2 into lt_t2_wa.
READ TABLE LT_T2 INTO LT_T2_WA WITH KEY HKONT IN ( '0001152430', '0001152930', '0001152410' ).
endloop.
thanks & Regards,
Balaji.S
Similar Messages
-
Select max date from a table with multiple records
I need help writing an SQL to select max date from a table with multiple records.
Here's the scenario. There are multiple SA_IDs repeated with various EFFDT (dates). I want to retrieve the most recent effective date so that the SA_ID is unique. Looks simple, but I can't figure this out. Please help.
SA_ID CHAR_TYPE_CD EFFDT CHAR_VAL
0000651005 BASE 15-AUG-07 YES
0000651005 BASE 13-NOV-09 NO
0010973671 BASE 20-MAR-08 YES
0010973671 BASE 18-JUN-10 NOHi,
Welcome to the forum!
Whenever you have a question, post a little sample data in a form that people can use to re-create the problem and test their ideas.
For example:
CREATE TABLE table_x
( sa_id NUMBER (10)
, char_type VARCHAR2 (10)
, effdt DATE
, char_val VARCHAR2 (10)
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0000651005, 'BASE', TO_DATE ('15-AUG-2007', 'DD-MON-YYYY'), 'YES');
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0000651005, 'BASE', TO_DATE ('13-NOV-2009', 'DD-MON-YYYY'), 'NO');
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0010973671, 'BASE', TO_DATE ('20-MAR-2008', 'DD-MON-YYYY'), 'YES');
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0010973671, 'BASE', TO_DATE ('18-JUN-2010', 'DD-MON-YYYY'), 'NO');
COMMIT;Also, post the results that you want from that data. I'm not certain, but I think you want these results:
` SA_ID LAST_EFFD
651005 13-NOV-09
10973671 18-JUN-10That is, the latest effdt for each distinct sa_id.
Here's how to get those results:
SELECT sa_id
, MAX (effdt) AS last_effdt
FROM table_x
GROUP BY sa_id
; -
Read internal table with key not equal to
Hi,
How can I read internal table with key not equal to some other field.
Basically in read statement we can read only fields equal to others fields.Hi,
Test the following Code you can Use Loop at for this But not Read Table
DATA: BEGIN OF it_test OCCURS 10,
f1(4),
f2 TYPE i,
f3(2),
END OF it_test.
DATA: it_test2 LIKE STANDARD TABLE OF it_test WITH HEADER LINE.
it_test-f1 = '1000'.
it_test-f2 = 10.
it_test-f3 = 'B'.
APPEND it_test TO it_test.
it_test-f1 = '2000'.
it_test-f2 = 10.
it_test-f3 = 'A'.
APPEND it_test TO it_test.
it_test-f1 = '1000'.
it_test-f2 = 10.
it_test-f3 = 'B'.
APPEND it_test TO it_test.
it_test-f1 = '1000'.
it_test-f2 = 10.
it_test-f3 = 'A'.
APPEND it_test TO it_test.
it_test-f1 = '1000'.
it_test-f2 = 40.
it_test-f3 = 'A'.
APPEND it_test TO it_test.
LOOP AT it_test INTO it_test WHERE f3 NE 'A'.
WRITE: / it_test-f1, it_test-f2, it_test-f3.
ENDLOOP.
Kind Regards,
Faisal -
Program times out while looping at internal table with huge records - Needs fine tuning suggestions
Hi,
I am trying to execute a report. It times out while looping at vbap internal table. This internal table has 140000 records and does the validation within this loop and geenrates data for the output. Due to this huge volume, the program times out when executed foreground.
There are no nested loops, so I cannot apply 'Parallel Cursor' here.
Is there any way I can fine tune the program so that it doesn't timeout? Is it possible to apply 'Parallel Processing' . If yes, how?
Thanks,
PavanHi Pavan ,
->sort your internal table by all primary key for vbap.
->Read a Record from the table (use your condition here)
->if record satisfys your where condition ,get that record index .
->loop the table from the index (without condition) .
its like parallel cursor only but for single loop .;-)
->use field symbols ,wherever possible .
if still dump is coming ,contact your basis team .
regards,
Krishna. -
Read from file to Internal Table With Extra Record
Hi,
I'm trying to read file from application server into internal table. Then loop thru the internal table and display.
My text file only have 2 rows of records. However, when display the internal table, it show the 2 records plus an extra line with 0. May I know where did I do wrong?
PARAMETERS: p_infile LIKE rlgrap-filename OBLIGATORY DEFAULT '/usr/sap/'..
DATA: ld_file LIKE rlgrap-filename.
*Internal tabe to store upload data
TYPES: BEGIN OF t_record,
name1 like pa0002-VORNA,
name2 like pa0002-name2,
age type i,
END OF t_record.
DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
wa_record TYPE t_record.
*Text version of data table
TYPES: begin of t_uploadtxt,
name1(10) type c,
name2(15) type c,
age(5) type c,
end of t_uploadtxt.
DATA: wa_uploadtxt TYPE t_uploadtxt,
wa_upload TYPE t_uploadtxt.
*String value to data in initially.
DATA: wa_string(255) type c.
START-OF-SELECTION.
ld_file = p_infile.
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT SPACE INTO wa_uploadtxt-name1 wa_uploadtxt-name2 wa_uploadtxt-age.
MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
APPEND wa_upload to it_record.
ENDIF.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
END-OF-SELECTION.
loop at it_record INTO wa_record.
write / wa_record-name1.
write / wa_record-name2.
write / wa_record-age.
Endloop.Hi,
Am attaching the file I used. There's no empty line after the second record.
After execute, it is showing:
Joe Adams 20
0
John Smith 40
0
May I know why there's 0, where did i do wrong?
Thank you. -
How to read from an internal table with multiple key fields.
Hi All!!
I want to read from an internal table having keys as k1,k2,k3.
How can I use read statement to read an entry having this as the key fields.
Thanks in adavance..
Prabhas Jhahi there
use:
sort itab by K1 K2 K3.
read table itab into wa with key K1 = value 1
K2 = value2
K3 = value 3
BINARY SEARCH.
where:
itab is ur internal table
wa is the work area with the same line type as the itab
cheers
shivika -
Populating a temp table with multiple records.
I want to populate a temp table with a a set of recs. This table will be used for
crossing/joining with my other tables to pull out data.
ie:
Main table (loc)contains these fields -> county,permit,utme,utmn
Temp table ( tmpid) contains these fields -> countytemp, permittemp
So I will be doing a statement like this once my temp table is populated.
Select l.county,l.permit,l.utme,l.utmn from loc l,tmpid t where l.county=t.countytemp and l.permit=t.permittemp;
So this temp table will basically be a list of ids that can range from a few recs to several hundred.
I want to know is there is way I can poplulate/repopulate it easily using sqlPlus/other by reading in a Ascii file
from client PCs. (besides SQL loader).HI
let me explain my requirement first,
i need to populate my block with the results from the following sql
SELECT * from contactdet where
(Month=12 and TrType='MTM' and FinYr='04-05' and Userid='SA009' and Clcode='SB001')
UNION
SELECT * from contactdetSUM where (Clcode='SB001' AND CSCODE='AB001')
Pease note. the where clauses i have put are different in each table and my requirement is
the constants values i have put in where clause should be variable (ie. i should be able to put variables like :clcode or so)
I tried us using Query data source type as 'FROM clause query' but it does not allow me to put variables in where clause.
Is there any way out i can do this ? Please help me
Regards
Uday -
Fill a table with multiple records
REPORT REPORT1.
DATA: wa_itab1 LIKE TABLE1.
DATA: wa_itab2 LIKE TABLE2.
DATA: itab1 TYPE STANDARD TABLE OF TABLE1,
itab2 TYPE STANDARD TABLE OF TABLE2.
DATA: v_dat TYPE d VALUE '20080101'.
SELECT * FROM TABLE1 INTO TABLE itab1.
LOOP AT itab1 INTO wa_itab1.
wa_itab2-FIELD1 = wa_itab1-FIELD1.
wa_itab2-FIELD2 = wa_itab1-FIELD2.
wa_itab2-FIELD3 = wa_itab1-FIELD3.
wa_itab2-FIELD4 = v_dat. "pass the initialized date
APPEND wa_itab2 TO itab2.
v_dat = v_dat + 1. " increment the date
IF v_dat GT '20080105'.
EXIT.
ENDIF.
ENDLOOP.
MODIFY TABLE2 FROM TABLE itab2.
I have the program above which is not doing exactly what I need. Lets say TABLE1 has 3 records
FIELD1 FIELD2 FIELD3
PLANT1 STOR_LOC1 20
PLANT2 STOR_LOC2 30
PLANT3 STOR_LOC3 40
The loop is for 5 days so in TABLE2 I want to see the following
FIELD1 FIELD2 FIELD3 FIELD4
PLANT1 STOR_LOC1 20 20080101
PLANT2 STOR_LOC2 30 20080101
PLANT3 STOR_LOC3 40 20080101
PLANT1 STOR_LOC1 20 20080102
PLANT2 STOR_LOC2 30 20080102
PLANT3 STOR_LOC3 40 20080102
PLANT1 STOR_LOC1 20 20080103
PLANT2 STOR_LOC2 30 20080103
PLANT3 STOR_LOC3 40 20080103
PLANT1 STOR_LOC1 20 20080104
PLANT2 STOR_LOC2 30 20080104
PLANT3 STOR_LOC3 40 20080104
PLANT1 STOR_LOC1 20 20080105
PLANT2 STOR_LOC2 30 20080105
PLANT3 STOR_LOC3 40 20080105
At the moment the program gives me
FIELD1 FIELD2 FIELD3 FIELD4
PLANT1 STOR_LOC1 20 20080101
PLANT2 STOR_LOC2 30 20080101
PLANT3 STOR_LOC3 40 20080101
Do I need a WHERE clause and if so how do I add assuming that the equal fields are FIELD1 and FIELD2? ThanksI have added a DO condition to the program and tried a couple of attempts. The latest is below. With this attempt I get 80,000+ records the majority of which do not have the fields filled. Thanks
REPORT REPORT1.
DATA: wa_itab1 LIKE TABLE1.
DATA: wa_itab2 LIKE TABLE2.
DATA: itab1 TYPE STANDARD TABLE OF TABLE1,
itab2 TYPE STANDARD TABLE OF TABLE2.
DATA: v_dat TYPE d VALUE '20080101'.
SELECT * FROM TABLE1 INTO TABLE itab1.
DO v_dat+1 TIMES.
LOOP AT itab1 INTO wa_itab1.
wa_itab2-FIELD1 = wa_itab1-FIELD1.
wa_itab2-FIELD2 = wa_itab1-FIELD2.
wa_itab2-FIELD3 = wa_itab1-FIELD3.
wa_itab2-FIELD4 = v_dat. "pass the initialized date
APPEND wa_itab2 TO itab2.
v_dat = v_dat + 1. " increment the date
IF v_dat GT '20080105'.
EXIT.
ENDIF.
ENDLOOP.
ENDDO.
MODIFY TABLE2 FROM TABLE itab2. -
Joining Three Tables with multiple record
Dear All
we need some help. We have Three Tables in sqlserver2012
Master Table
OrderID PackageID CustomerName
1 1 Abc
2 2 Bcd
3 1 xyz
Child1 Table
OrderID ControlName
1 Row1COlumn1 (It Means Pant in Red Color is selected by user(relation with Child2 Table))
1 Row3Column1 (It Means Gown in Blue Color is selected by user(relation with Child2 Table))
1 Row4Column3 (It Means T Shirt in White Color is selected by user(relation with Child2 Table))
2 Row1Column2 (It Means Tie in Green Color is selected by user(relation with Child2 Table))
2 Row3Column1 (It Means Bow in Red Color is selected by user(relation with Child2 Table))
Child2 Table
PackageID Product Color1 Color2 Color3
1 Pant Red Green Blue
1 Shirt Blue Pink Purple
1 Gown Blue Black Yellow
1 T Shirt Red Green White
2 Tie Red Green White
2 Socks Red Green White
2 Bow Red Green White
We want to have result like
OrderID PackageID CustomerName Pant Gown T Shirt Tie Bow
1 1 ABC Red Blue White x
x
Blue
2 2 Bcd x x x
Green Red
I have tried
;with mycte as (
select ms.OrderID,ms.PackageID
,ms.CustomerName
, Replace(stuff([ControlName], charindex('Column',ControlName),len(ControlName),''),'Row','') rowNum
,Replace(stuff([ControlName], 1, charindex('Column',ControlName)-1 ,''),'Column','') columnNum
From child1 c inner join MasterTable ms on c.Orderid=ms.orderid)
,mycte1 as (
select *, row_number() Over(Partition By PackageID Order By Child2ID) rn from child2
,mycte2 as (
Select m.OrderID,m.PackageID, m.CustomerName, m.ColumnNum, m1.Product
--,m1.Color1 , m1.Color2, m1.Color3
, Case WHEN ColumnNum= 1 Then Color1
WHEN ColumnNum= 1 Then Color1
WHEN ColumnNum= 2 Then Color2
WHEN ColumnNum= 3 Then Color3 End Colors
from mycte m
join mycte1 m1 on m.rowNum=m1.rn and m.PackageID=m1.PackageID)
Select OrderID,PackageID,CustomerName, ISNULL(Max(Case WHen Product='Pant' Then Colors END),'X') as 'Pant'
, ISNULL(Max(Case WHen Product='Gown' Then Colors END),'X') as 'Gown'
, ISNULL(Max(Case WHen Product='T Shirt' Then Colors END),'X') as 'T Shirt'
, ISNULL(Max(Case WHen Product='Tie' Then Colors END),'X') as 'Tie'
, ISNULL(Max(Case WHen Product='Bow' Then Colors END),'X') as 'Bow'
FROM mycte2
Group by OrderID,PackageID, CustomerName
it works if we have a product in one color only. like if we have pant in red and blue then its showing just first record
Thanks and Best Regards UmairAre you really storing textual values like "Row3Column1" or "Row4Column3"???
Your model is a mess. Redesign it.. btw, these kind of models are quite complex.
USE tempdb;
GO
CREATE TABLE dbo.Colors
ColorID INT NOT NULL ,
ColorName NVARCHAR(255) NOT NULL ,
CONSTRAINT PK_Colors PRIMARY KEY ( ColorID )
CREATE TABLE dbo.Products
ProductID INT NOT NULL ,
ProductName NVARCHAR(255) NOT NULL ,
CONSTRAINT PK_Products PRIMARY KEY ( ProductID ) ,
CONSTRAINT UQ_Products_ProductName UNIQUE ( ProductName )
CREATE TABLE dbo.Packages
PackageID INT NOT NULL ,
CONSTRAINT PK_Packages PRIMARY KEY ( PackageID )
CREATE TABLE dbo.PackageDetails
ColorID INT NOT NULL ,
PackageID INT NOT NULL ,
ProductID INT NOT NULL ,
CONSTRAINT PK_PackageDetails PRIMARY KEY ( ColorID, PackageID, ProductID ) ,
CONSTRAINT FK_PackageDetails_ColorID FOREIGN KEY ( ColorID ) REFERENCES dbo.Colors ( ColorID ) ,
CONSTRAINT FK_PackageDetails_PackageID FOREIGN KEY ( PackageID ) REFERENCES dbo.Packages ( PackageID ) ,
CONSTRAINT FK_PackageDetails_ProductID FOREIGN KEY ( ProductID ) REFERENCES dbo.Products ( ProductID )
CREATE TABLE dbo.Orders
OrderID INT NOT NULL ,
CustomerID INT NOT NULL ,
PackageID INT NOT NULL ,
CONSTRAINT PK_Orders PRIMARY KEY ( OrderID ) ,
CONSTRAINT UQ_Orders_CustomerID UNIQUE ( OrderID, PackageID ) ,
CONSTRAINT FK_Orders_PackageID FOREIGN KEY ( PackageID ) REFERENCES dbo.Packages ( PackageID )
CREATE TABLE dbo.OrderDetails
ColorID INT NOT NULL ,
OrderID INT NOT NULL ,
PackageID INT NOT NULL ,
ProductID INT NOT NULL ,
CONSTRAINT FK_OrderDetails_Orders FOREIGN KEY ( OrderID, PackageID ) REFERENCES dbo.Orders ( OrderID, PackageID ) ,
CONSTRAINT FK_OrderDetails_PackageDetails FOREIGN KEY ( ColorID, PackageID, ProductID ) REFERENCES dbo.PackageDetails ( ColorID, PackageID, ProductID )
GO
INSERT INTO dbo.Colors
( ColorID, ColorName )
VALUES ( 1, 'Red' ),
( 2, 'Green' ),
( 3, 'Blue' ),
( 4, 'Pink' ),
( 5, 'Purple' ),
( 6, 'Black' ),
( 7, 'Yellow' ),
( 8, 'White' );
INSERT INTO dbo.Products
( ProductID, ProductName )
VALUES ( 1, 'Pant' ) ,
( 2, 'Shirt' ) ,
( 3, 'Gown' ) ,
( 4, 'T Shirt' ) ,
( 5, 'Tie' ) ,
( 6, 'Socks' ) ,
( 7, 'Bow' );
INSERT INTO dbo.Packages
( PackageID )
VALUES ( 1 ),
( 2 );
INSERT INTO dbo.PackageDetails
( PackageID, ProductID, ColorID )
VALUES ( 1, 1, 1 ),
( 1, 2, 3 ),
( 1, 3, 3 ),
( 1, 4, 1 ),
( 2, 5, 1 ),
( 2, 6, 1 ),
( 2, 7, 1 ),
( 1, 1, 2 ),
( 1, 2, 4 ),
( 1, 3, 6 ),
( 1, 4, 2 ),
( 2, 5, 2 ),
( 2, 6, 2 ),
( 2, 7, 2 ),
( 1, 1, 3 ),
( 1, 2, 5 ),
( 1, 3, 7 ),
( 1, 4, 8 ),
( 2, 5, 8 ),
( 2, 6, 8 ),
( 2, 7, 8 );
INSERT INTO dbo.Orders
( OrderID, PackageID, CustomerID )
VALUES ( 1, 1, 1 ),
( 2, 2, 2 ),
( 3, 1, 3 );
INSERT INTO dbo.OrderDetails
( ColorID, OrderID, PackageID, ProductID )
VALUES ( 1, 1, 1, 1 ),
( 3, 1, 1, 3 ),
( 8, 1, 1, 4 ),
( 2, 2, 2, 5 ),
( 1, 2, 2, 7 );
GO
SELECT *
FROM dbo.Orders O
INNER JOIN dbo.OrderDetails OD ON OD.OrderID = O.OrderID
INNER JOIN dbo.Products P ON P.ProductID = OD.ProductID
INNER JOIN dbo.Colors C ON C.ColorID = OD.ColorID;
GO
DROP TABLE dbo.OrderDetails;
DROP TABLE dbo.Orders;
DROP TABLE dbo.PackageDetails;
DROP TABLE dbo.Packages;
DROP TABLE dbo.Products;
DROP TABLE dbo.Colors;
GO -
How to read an internal table by comparing the values of key fields
hi ,
i want to read internal table with multiple values for the key field . can anyone suggest the syntax or method for doing this,
thanks in advance.
regards,
manojHi,
Read statement will read only one value at a time..
You can only compare with different values.
example :
read table it_mara into wa_mara with key matnr = '1000'
matnr = '2000'
matnr = '3000'.
if all the 3 records are found in the internal table then it will read the 1 record.
Regards
Satish Boguda -
Problem with Multiple record creation using BAPI BAPI_PRICES_CONDITION
Hi,
I am working on IS Media Sales And Distribution wherein i am using BAPI BAPI_PRICES_CONDITION for condition record creation in TCODE JC9B. I am able to create one record using this BAPI for one sales promotion but having problem while creation of multiple records for the same sales promotion wherein my internal table have multiple records. It gives me error that data in BAPICONDIT is missing.
I am aatching followig code for reference
BAPI have field of varkey which i am filling as combination of sales org. + distn channel + sales promotion + delivery type
In this varkey delivery type is changing for sales promotion Can be said that one sales promotion can have multiple delivery type .
Am i giving the correct varkey for each itration of internal table ?
I am attaching code for reference.
Here loop it_cond contain one promotion and multiple delivery type.
sales org distn ch promotion delivery
0100 01 zsalesprom 03
0100 01 zsalesprom z3
LOOP AT it_cond INTO wa_cond.
Get next condition number
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = 'KONH'
QUANTITY = '1'
SUBOBJECT = ' '
TOYEAR = '0000'
IGNORE_BUFFER = ' '
IMPORTING
number = number
QUANTITY =
RETURNCODE =
EXCEPTIONS
INTERVAL_NOT_FOUND = 1
NUMBER_RANGE_NOT_INTERN = 2
OBJECT_NOT_FOUND = 3
QUANTITY_IS_0 = 4
QUANTITY_IS_NOT_1 = 5
INTERVAL_OVERFLOW = 6
BUFFER_OVERFLOW = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Here i am concacating varkey for each new delivery
CLEAR : l_min,l_length,l_var.
CONCATENATE wa_cond-vkorg wa_cond-vtweg wa_cond-wrbakt INTO l_var.
l_length = STRLEN( l_var ).
IF l_var+14(2) IS INITIAL.
WRITE wa_cond-lifart TO L_VAR+14.
l_length = STRLEN( l_var ).
ENDIF.
W_LINE = W_LINE + 1.
*First table in BAPI
wa_bapicondct-operation = '009'.
wa_bapicondct-cond_usage = 'A'.
wa_bapicondct-table_no = '506'.
wa_bapicondct-applicatio = 'J0'.
wa_bapicondct-cond_type = 'RATE'.
wa_bapicondct-varkey = l_var.
wa_bapicondct-valid_to = wa_cond-datbi.
wa_bapicondct-valid_from = wa_cond-datab.
wa_bapicondct-cond_no = number. "
APPEND wa_bapicondct TO it_bapicondct.
*Second table in BAPI
wa_bapicondhd-operation = '009'.
wa_bapicondhd-cond_no = number.
wa_bapicondhd-cond_usage = 'A'.
wa_bapicondhd-table_no = '506'.
wa_bapicondhd-created_by = sy-uname.
wa_bapicondhd-creat_date = sy-datum.
wa_bapicondhd-applicatio = 'J0'.
wa_bapicondhd-cond_type = 'RATE'.
wa_bapicondhd-varkey = l_var.
wa_bapicondhd-valid_from = wa_cond-datab.
wa_bapicondhd-valid_to = wa_cond-datbi.
APPEND wa_bapicondhd TO it_bapicondhd.
*Third table in BAPI
wa_bapicondit-operation = '009'.
wa_bapicondit-cond_no = number.
wa_bapicondit-cond_count = wa_cond-cond_count.
wa_bapicondit-applicatio = 'J0'.
wa_bapicondit-cond_type = 'RATE'.
wa_bapicondit-calctypcon = 'C'.
wa_bapicondit-scaletype = 'A'.
wa_bapicondit-cond_value = wa_cond-kbetr.
wa_bapicondit-condcurr = wa_cond-konwa.
wa_bapicondit-promotion = wa_cond-wrbakt.
APPEND wa_bapicondit TO it_bapicondit.
*Fourth table in BAPI
wa_bapicondqs-operation = '009'.
wa_bapicondqs-cond_no = number.
wa_bapicondqs-cond_count = wa_cond-cond_count.
wa_bapicondqs-currency = wa_cond-kbetr.
wa_bapicondqs-condcurr = wa_cond-konwa.
wa_bapicondqs-cond_unit = 'EA'.
wa_bapicondqs-LINE_NO = W_LINE."'0001'.
APPEND wa_bapicondqs TO it_bapicondqs.
*Fifth table in BAPI
wa_bapicondvs-operation = '009'.
wa_bapicondvs-cond_no = number.
wa_bapicondvs-cond_count = wa_cond-cond_count.
wa_bapicondvs-currenckey = wa_cond-konwa.
wa_bapicondvs-currenciso = wa_cond-konwa.
wa_bapicondvs-currency = wa_cond-kbetr.
wa_bapicondvs-condcurr = wa_cond-konwa.
wa_bapicondvs-curren_iso = wa_cond-konwa.
wa_bapicondvs-LINE_NO = W_LINE."'0001'.
APPEND wa_bapicondvs TO it_bapicondvs.
CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
EXPORTING
PI_INITIALMODE = ' '
PI_BLOCKNUMBER =
TABLES
ti_bapicondct = it_bapicondct
ti_bapicondhd = it_bapicondhd
ti_bapicondit = it_bapicondit
ti_bapicondqs = it_bapicondqs
ti_bapicondvs = it_bapicondvs
to_bapiret2 = it_bapiret2
to_bapiknumhs = it_bapiknumhs
to_mem_initial = it_cnd_mem_initial
EXCEPTIONS
update_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
RETURN =
CLEAR : wa_bapicondct,wa_bapicondhd,wa_bapicondvs,wa_bapicondqs.
CLEAR : wa_bapicondit.
ENDLOOP.
ENDIF.
ENDIF.
Kindly Suggest.
Thanks
ParagSolved By myself
There is problem while passing data to internal table for item level -
How to fill internal table with no data in debugging mode
Hi all,
I modified one existing program.Now I want to test it.I am not given test data.So in the middle of my debugging, I found that one internal table with no data.My problem is how to fill that internal table with few records in that debugging mode just as we change contents in debugging mode.If I want to proceed further means that internal table must have some records.
Please I dont know how to create test data so I am trying to create values temporarily in debugging mode only.
Thanks,
BalajiHi,
In the debugging do the following..
Click the Table button..
Double click on the internal table name..
Then in the bottom of the screen you will get the buttons like CHANGE, INSERT, APPEND, DELETE..
Use the APPEND button to insert records to the internal table..
Thanks,
Naren -
Create Internal table with fields coming as query result of multiple tables
Hi
I want to create internal table with the fileds which come as a result of a select query from multiple tablesMy code is something like this. I need the data from various fields of diff tables depending on the excel file. This data is then to be put in a internal table
*& Report Z_EXTC
report z_extc.
type-pools : abap.
parameter: objname(25) type c.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
data: p_table type string.
data:l_string type string,
l_filename(200) type c,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
types:begin of itab,
tabname type dd03l-tabname,
fieldname type dd03l-fieldname,
end of itab.
types:begin of atab,
tabname type dd03l-tabname,
cnt type string,
end of atab.
field-symbols: <dyn_table> type table,
<dyn_table1> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data,
dy_table1 type ref to data.
data: itab1 type itab occurs 0 with header line.
data atab1 type atab occurs 0 with header line.
data frstrec type i value 0.
data lastrec type i value 0.
l_string = ''.
call function 'GUI_UPLOAD'
exporting
filename = 'C:\excel_files\FIELDS_CC.TXT'
filetype = 'TXT'
has_field_separator = 'X' .
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
*Refresh itab1.
loop at itab1.
on change of: itab1-tabname.
if lastrec = 1.
move l_string to atab1-cnt.
move itab1-tabname to atab1-tabname.
append atab1.
l_string = ''.
endif.
move itab1-tabname to atab1-tabname.
frstrec = 1.
endon.
if frstrec = 1.
concatenate l_string itab1-fieldname into l_string separated by
space.
lastrec = 1.
endif.
*write:/ itab1-tabname,40 itab1-fieldname.
endloop.
move l_string to atab1-cnt.
append atab1.
loop at atab1.
write:/ atab1-tabname,5 atab1-cnt.
endloop. -
How to read an internal table with more than one (2 or 3) key field(s).
how to read an internal table with more than one (2 or 3) key field(s). in ecc 6.0 version
hi ,
check this..
report.
tables: marc,mard.
data: begin of itab occurs 0,
matnr like marc-matnr,
werks like marc-werks,
pstat like marc-pstat,
end of itab.
data: begin of itab1 occurs 0,
matnr like mard-matnr,
werks like mard-werks,
lgort like mard-lgort,
end of itab1.
parameters:p_matnr like marc-matnr.
select matnr
werks
pstat
from marc
into table itab
where matnr = p_matnr.
sort itab by matnr werks.
select matnr
werks
lgort
from mard
into table itab1
for all entries in itab
where matnr = itab-matnr
and werks = itab-werks.
sort itab1 by matnr werks.
loop at itab.
read table itab1 with key matnr = itab-matnr
werks = itab-werks.
endloop.
regards,
venkat. -
Nested Internal tables with cl_gui_alv_grid - not displaying records
Hi,
I wrote a program using nested internal tables with cl_gui_alv_grid class
At runtime, when I select dropdown on one of the cells (RESWK - driver to the nested table), it does not bring the related record and display it
Does cl_gu_alv_grid support nested internal tables?
Or which class to use
Appreciate reply at the latest
Thanks
Rajeev
Edited by: Thomas Zloch on Feb 7, 2011 4:11 PM - priority reducedHi Rajeev,
Maybe checking out this documnetation will answer your question:
[ALV Grid Control (BC-SRV-ALV)|http://help.sap.com/saphelp_erp2004/helpdata/EN/bf/3bd1369f2d280ee10000009b38f889/frameset.htm]
To my knowledge ALV does not support deep structures.
Kind regards,
Robert
Maybe you are looking for
-
Copying iTunes to external hard drive
Hi All, I am trying to copy my iTunes folder to an external hard drive to transfer to a new laptop. I have followed the instruction online, consolidate in iTunes, close iTunes, drag and drop to external hard drive etc. However, it get to about 3/4 o
-
Can Server Software be installed & Running without My knowledge/Consent
Hi, Please excuse my naivitee. I am running an old but fast G4 tower on alocal network with little sharing. After a clean install and using software update, I am seeing a repeated attempt to download and install OSX Server software throughthe logs, p
-
PL/SQL parser for 7.3 DB?
We have an ORACLE 7.3 DB and are looking for a PL/SQL parser for XML... Some of the posts I've seen seem to suggest that a solution exists, but I'm not having any luck finding out for sure... Thanks, Jeff
-
Cannot connect to 127.0.0.1 on port 7101.
Hello Everyone, I'm using JDeveloper 11.1.2.3. I created a mobile application by which i do simple search in the database. I successfully created a web service and run it on the integrated server. Everything is great! I'm even able to start the servi
-
Cloning a VM: vhdx same name
Hello. I've exported a VM from one Hyper-V and imported it to another. When doing so, I noticed the actual file name for the vhdx during the import process did not change. It stayed the same name as the original. I could change the name in the Hy