Doubt In internal table using in GUI download
Hi,
how to get the field lable of all the fields in the internal table... when i download it to xls file... while downloading it i want to pass the field lable first and then its value.
eg. in mara table .
MATERIAL NO.
p-101
points will be rewarded for correct answer.
hi,
Actually i'm downloading the data from mara table to excel file i.e from mara -> internal table-> excel file.
In this i'm gettng all the values in excel file but i don't kno what those values exactly ment for , so i want the fields lable to be passed first.
But i don't kno how to get the field lables into the internal atble and then how to pass that value to the excel file.
Thanks.
Arunprasad.P
Similar Messages
-
How to Upload Excel sheet in DB or internal table using SAP NetWeaver ABAP
Dear All experts,
Pls provide guidance to Upload Excel sheet in DB or internal table using ABAP in ( SAP NetWeaver stack )
Regards
Machindra
Edited by: Machindra Patade on Apr 8, 2010 3:07 PMPlease search before posting.
Thread locked.
Thomas -
How to extract data from info cube into an internal table using ABAP code
HI
Can Anyone plz suggest me
How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
Thankx in advance
regds
AJAYHI Dinesh,
Thankq for ur reply
but i ahve already tried to use the function module.
When I try to Use the function module RSDRI_INFOPOV_READ
I get an information message "ERROR GENERATION TEST FRAME".
can U plz tell me what could be the problem
Bye
AJAY -
Delete row from internal table using field symbol.
Hi friends,
I created dynamic internal table using field symbol. I want to delete some data using where clause.
for example. i want to use like,
DELETE <FS> WHERE KUNNR = WA_KNA1-KUNNR.
Like the above statment it won't work. How i can use delete with where clause in field symbols.
Hope any one can help me.
Thanks and regards
Srikanth. Shi Srikanth,
I think you have to LOOP through the whole internal table and check each line and decide to delete or not:
LOOP at <itab> INTO <wa>.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <wa> TO <field>.
CHECK <field> IS ASSIGNED.
IF <field> EQ WA_KNA1-KUNNR.
DELETE ...
ENDIF.
UNASSIGN <field>.
ENDLOOP.
hope this helps
ec -
Doubts in internal table logic
Hi All,
I have two internal table, according to the posnr value i need to add the kbetr value from the 2nd internal table and update the value in the 1st line internal table. below the example of my internal table. Here for the line item 0010 i need to calculate 10.0030.1011.00 and i need to add the value inthe 1st internal table kbeter_value. can anyone help this?
POSNR MATNR kbetr_value
0010 abc
0020 xyz
0030 123
POSNR KBETR
0010 10.00
0010 30.10
0010 11.00
0010 60.30
0020 12.64
0020 11.32
0030 79.46
0030 00.00
0030 45.3
by
MohanaHi Mohana,
Its very simple ..you can do it in many ways....
first one is in the second internal table use collect ....
for example : 1st internal table is itab and the second is jtab .
1. In jtab u use collect stmt to calculate the posnr values .
loop at jtab.
collect jtab . " by using this u will have 0010 111.40 in jtab
endloop.
structure of jtab will be :
0010 111.40
0020 .........
0030 ..........
2. afterwards while printing you can use read to get those :
loop at itab.
read table jtab with key posnr = itab-posnr.
if sy-subrc = 0.
itab-ksbtr-value = itab-value .
modify itab .
endif.
endloop.
Hope you got it by now...if you any problem do reply back ....
cheers,
Vishnu . -
Internal table used by sap in a program
Hi,
I want to know the list of internal tables used in a program (including sap program).
while debugging i want to view the data stored in it.
I know the internal tables used by me. Before loading the program sap will load some information into internal table. How to know that.
Advance Thanks.Internal tables, not transparent ones.
In the old debugger, goto->system areas->internal information and look ITAB_HEADS. This will show you the name of the tables in the system. SYMBDATANM will show you all variables in memory.
In the new debugger, it's even easier. There's a global tab in the variables area, that tells you all variables in memory. And you can see the variable type - i.e. if it is a table.
matt -
Final Internal Table used in MIGO Transaction
Hi Experts,
I need to know the final internal table used in the MIGO transaction. Why I want to know this is, I need all the records which are there in the table control (GODYNPRO) of the MIGO transaction. I have used the BADI BADI MB_MIGO_BADI to read the values. But since it is a table control the values are getting changed when the user scrolls down the table control. How can I get all the values shown in this table control. Is there any global internal table in the SAPLMIGO program?
BR.Hi ABAP,
Check the BADI MB_MIGO_BADI the example class CL_EXM_IM_MB_MIGO_BADI
In attributes tab variable GT_EXTDATA contains all migo positions.
Read the internal table to check items.
in this method the internal table is filled.
Therefore define your internal table in the class attributes.
I hope you help. -
How to join THREE different tables into internal table using one select statement .
How to join THREE different tables into internal table using one select statement .
Hi experts,
I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
Scenario:
Database tables:
SPFLI
SFLIGHT
SBOOK.
Table Fields:
SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
SEATSOCC_C SEATSMAX_F SEATSOCC_F
SBOOK - CARRID CONNID CLASS
MY INTERNAL TABLE IS IT_XX.
Your help much appreciated.
Thanks in advance.
Pawan.Hi Pawan,
please check below codes. hope it can help you.
TYPES: BEGIN OF ty_xx,
carrid TYPE spfli-carrid ,
connid TYPE spfli-connid ,
countryfr TYPE spfli-countryfr,
cityfrom TYPE spfli-cityfrom ,
countryto TYPE spfli-countryto,
cityto TYPE spfli-cityto ,
fldate TYPE sflight-fldate ,
seatsmax TYPE sflight-seatsmax ,
seatsocc TYPE sflight-seatsocc ,
seatsmax_b TYPE sflight-seatsmax_b,
seatsocc_b TYPE sflight-seatsocc_b,
seatsmax_f TYPE sflight-seatsmax_f,
seatsocc_f TYPE sflight-seatsocc_f,
class TYPE sbook-class,
END OF ty_xx,
t_xx TYPE STANDARD TABLE OF ty_xx.
DATA: it_xx TYPE t_xx.
SELECT spfli~carrid
spfli~connid
spfli~countryfr
spfli~cityfrom
spfli~countryto
spfli~cityto
sflight~fldate
sflight~seatsmax
sflight~seatsocc
sflight~seatsmax_b
sflight~seatsocc_b
sflight~seatsmax_f
sflight~seatsocc_f
sbook~class
INTO TABLE it_xx
FROM spfli INNER JOIN sflight
ON spfli~carrid = sflight~carrid
AND spfli~connid = sflight~connid
INNER JOIN sbook
ON spfli~carrid = sbook~carrid
AND spfli~connid = sbook~connid.
Thanks,
Yawa -
Hi
I have a internal table with several entries. The entries are like this.
1 A X
1 B N
1 C D
2 B N
2 C K
3 G L
3 K M
I want to loop on this internal table and separate the entrie starting with 1 into a new internal table and entries starting with 2 into another table and entries starting with 3 into another table. Please note that the numbers 1, 2 and 3 ,I have given as an example. They might be different at runtime.
thanks
sankarhi sankar,
what you can do is just create a structure of destination internal table and LOOP on the present internal table and code FOR ON CHANGE
TYPES: BEGIN OF x_stru_dyn,
END OF x_stru_dyn.
LOOP AT itab into wa. "source internal table
ON CHANGE OF wa-keyfield.
create new internal table of x_stru_dyn TYPE and refer it by Field symbol.
ENDON.
write code for filling the data from <b>wa</b> to new internal table using field symbol
ENDLOOP.
give points if useful.
Regards,
Sachin. -
Download database table content into internal table using Function Module?
HI,
Experts,
I need a function module which can download ddic table content into internal table.
Thank u ,
Shabeer Ahmed.>
shabeer ahmed wrote:
> HI,
> Experts,
>
> I need a function module which can download ddic table content into internal table.
>
> Thank u ,
> Shabeer Ahmed.
Hi Shabeer,
We don't require a function module to download ddic table content to an internal table. We can use the SELECT statement for the same. Example would be:-
DATA: <INTERNAL TABLE> type table of <DATABASE>.
SELECT * FROM <DATABASE> into corresponding fields of <INTERNAL TABLE>.
Also, function module might be required when you need the data from a remote system, but then it is the developer's task create this function module and the function module should be remote enabled function module.
This remote enable function module should have the above SELECT query as its code.
Many Regards,
Ravi. -
Code to transfer xml file to abap internal table using transformation
Hi friends
Given the following xml file .the requirementis to display and transfer the xml file to internal table usin transformation and gui_upload.If any onehaving simple code on this please send .
Can any one sugest the steps to be followed to write source code using simple transformation.
<?xml version="1.0" encoding="utf-8" ?>
- <Negara>
- <item>
- <COUNTRY>
<MANDT>600</MANDT>
<ZCODE>500</ZCODE>
<ZDESC>Pening Lalat</ZDESC>
<ZSAPCD>T1</ZSAPCD>
</COUNTRY>
</item>
- <item>
- <COUNTRY>
<MANDT>600</MANDT>
<ZCODE>600</ZCODE>
<ZDESC>Pening Lalat2</ZDESC>
<ZSAPCD>T2</ZSAPCD>
</COUNTRY>
</item>
</Negara>
Thaking Youhi..
1. itab --- > xml
xml ---> itab.
2. This program will do both.
(just copy paste in new program)
3.
REPORT abc.
DATA
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
a(100) TYPE c,
END OF itab.
DATA: xml_out TYPE string .
DATA : BEGIN OF upl OCCURS 0,
f(255) TYPE c,
END OF upl.
DATA: xmlupl TYPE string .
FIRST PHASE
FIRST PHASE
FIRST PHASE
Fetch Data
SELECT * FROM t001 INTO TABLE t001.
XML
CALL TRANSFORMATION ('ID')
SOURCE tab = t001[]
RESULT XML xml_out.
Convert to TABLE
CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
EXPORTING
i_string = xml_out
i_tabline_length = 100
TABLES
et_table = itab.
Download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filetype = 'BIN'
filename = 'd:\xx.xml'
TABLES
data_tab = itab.
SECOND PHASE
SECOND PHASE
SECOND PHASE
REFRESH t001.
CLEAR t001.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'D:\XX.XML'
filetype = 'BIN'
TABLES
data_tab = upl.
LOOP AT upl.
CONCATENATE xmlupl upl-f INTO xmlupl.
ENDLOOP.
XML
CALL TRANSFORMATION ('ID')
SOURCE XML xmlupl
RESULT tab = t001[].
<b>Reward points if useful</b>
Regards
Ashu -
Count No of records in an internal table using 4 fields
Hi All,
I have an internal table with about 50,000 records. I need to group these (sort) based on 4 fields and then provide the count for each combination of the 4 fields.
For eg, if I have 3 records in the table which have the same values for all the 4 fields - say A,B,C,D, then the count is to be taken as 3 for that combination.
So my output will be
A B C D - COUNT -4 and so on.
I am looking for a efficient technique (good performance) to meet the above requirements given without too many loops. Please advise if you have a good method.
Thanks as always!
LizYou can use SORT and DELETE ADJACENT DUPLICATES FROM.
SORT itab by field1 field2 field3 field4.
DELETE ADJACENT DUPLICATES FROM itab COMPARING field1 field2 field3 field4.
you will be left with the unique combinations of the 4 fields.
LINES( itab ) will give you the number of records.
Thanks,
Sai Ramesh. -
Select entries present in an internal table using a range of key values
Hi guys,
I have an internal table tb_bseg.
It contains the vendor code (lifnr), document number (belnr) and other fields.
How can I select values so that it may follow my (lifnr) range values in the selection screen?
SELECT belnr lifnr gsber mwskz hwbas wrbtr anln1 aufnr prctr projk nplnr kostl FROM bseg INTO TABLE tb_bseg
WHERE bukrs = pa_bukrs
AND belnr = tb_bkpf-belnr
AND gjahr = tb_bkpf-gjahr.
AND lifnr IN cd_lifnr. ??? can I use something like this?
Please guide me regarding this.
Best regards,
ReymarHi Reymar,
You are right . You can use that way. So your select query will be
SELECT belnr lifnr gsber mwskz hwbas wrbtr anln1 aufnr prctr projk nplnr kostl FROM bseg INTO TABLE tb_bseg
WHERE bukrs = pa_bukrs
AND belnr = tb_bkpf-belnr
AND gjahr = tb_bkpf-gjahr
AND lifnr IN cd_lifnr.
where cd_lifnr is the selection screen field.
declare it as
SELECT-OPTIONS :
CD_LIFNR FOR BSEG-LIFNR.
Regards,
Swapna.
Edited by: NagaSwapna Thota on Sep 4, 2008 5:19 PM -
XML to Internal table using XSLT by CALL TRANSFORMATION error
Dear experts,
I have to fetch the data from an XML file using XSLT into internal tables. The XML file is very big as following:-
<?xml version="1.0" standalone="yes" ?>
- <Shipment>
<shipmentID>25091203S000778</shipmentID>
<manifestDateTime>2009-12-03T20:16:52.00</manifestDateTime>
<shipmentFacilityNumber>025</shipmentFacilityNumber>
<shipmentFacilityAbbreviation>CHI</shipmentFacilityAbbreviation>
<shipmentFacilityAddress1>810 KIMBERLY DRIVE</shipmentFacilityAddress1>
<shipmentFacilityAddress2 />
<shipmentFacilityCity>CAROL STREAM</shipmentFacilityCity>
<shipmentFacilityState>IL</shipmentFacilityState>
<shipmentFacilityPostalCode>601880000</shipmentFacilityPostalCode>
<shipmentTruckCarrierCode>X150</shipmentTruckCarrierCode>
<shipmentSourceCode>T</shipmentSourceCode>
<userID>CAMPOSG</userID>
- <Delivery>
<primaryCustomerNumber>954371</primaryCustomerNumber>
<primaryCustomerName>MIDWEST OFFICE SUPPLY</primaryCustomerName>
<primaryCustomerAddress1 />
<primaryCustomerAddress2>4765 INDUSTRIAL DR</primaryCustomerAddress2>
<primaryCustomerCity>SPRINGFIELD</primaryCustomerCity>
<primaryCustomerState>IL</primaryCustomerState>
<primaryCustomerPostalCode>627030000</primaryCustomerPostalCode>
<primaryCustomerPhoneNumber>2177535555</primaryCustomerPhoneNumber>
<shuttleStopFacilityNumber />
<billOfLadingNumber>25HZK99</billOfLadingNumber>
<carrierProNumber />
<shipmentTotalCartonCount>6</shipmentTotalCartonCount>
<shipmentTotalWeight>266</shipmentTotalWeight>
- <order>
<orderNumber>25HZK99</orderNumber>
<subOrderNumber />
<dateProcessed>2009-12-03</dateProcessed>
<primaryOrderNumber />
<shipTruckCode>X150</shipTruckCode>
<shipTruckDescription>UDS - ADDISON</shipTruckDescription>
<shipTruckPriorityCode>01</shipTruckPriorityCode>
<shipTruckGroupCode>01</shipTruckGroupCode>
<shipTruckDepartureTime>20.00.00</shipTruckDepartureTime>
<shipTruckDockID>07</shipTruckDockID>
<ldpFacilityAbbreviation />
<shuttleAvailableIndicator>N</shuttleAvailableIndicator>
<shuttleMessageText />
<crossDockFacilityCode />
<crossDockTruckCode />
<crossDockID />
<subsidizedFreightTruckID />
<customerPurchaseOrderNumber>623559</customerPurchaseOrderNumber>
<headerTypeCode>P</headerTypeCode>
<orderTypeID>RG</orderTypeID>
<deliveryTypeID>DS</deliveryTypeID>
<deliveryMethodCode />
<customerBarCode />
<customerReferenceData>25HZK99</customerReferenceData>
<customerReferenceText />
<customerRouteData>ZNED UNTED</customerRouteData>
<customerRouteText>ROUTE</customerRouteText>
<endConsumerPurchaseOrderNumber />
<endConsumerPurchaseOrderText />
<endConsumerName>CHARLESTON TRANS. FACILITY</endConsumerName>
<endConsumerAddress1>HOMEWOOD DT PROGRAM DEPT. 3</endConsumerAddress1>
<endConsumerAddress2>17341 PALMER BLVD.</endConsumerAddress2>
<endConsumerAddress3 />
<endConsumerCity>HOMEWOOD</endConsumerCity>
<endConsumerState>IL</endConsumerState>
<endConsumerPostalCode>60430</endConsumerPostalCode>
<endConsumerCountryCode />
<fillFacilityNumber>025</fillFacilityNumber>
<shpFacilityNumber>025</shpFacilityNumber>
<homeFacilityAbbrCode>STL</homeFacilityAbbrCode>
<homeFacilityNumber>015</homeFacilityNumber>
<multiCartonIndicator>Y</multiCartonIndicator>
<primaryCustomerIndicator>Y</primaryCustomerIndicator>
<shipToCustomerNumber>954371001</shipToCustomerNumber>
<customerCompanyID>01</customerCompanyID>
<customerTruckID>U888</customerTruckID>
<customerTruckDescription>UDS - ADDISON</customerTruckDescription>
<customerTruckDockID>13</customerTruckDockID>
<thirdPartyBillCarrier />
<thirdPartyBillID />
<thirdPartyBillType />
<qualityCheckIndicator>N</qualityCheckIndicator>
<warehouseLaydownID />
<packListPosition>I</packListPosition>
<preferredPackingType>CTN</preferredPackingType>
<preferredPackingMaterial>PAPER</preferredPackingMaterial>
<preferedPackingInstructions />
<totalOrderCartonQty>6</totalOrderCartonQty>
<convertAddressIndicator>N</convertAddressIndicator>
<dealerInstructionIndicator>Y</dealerInstructionIndicator>
<dealerinstructions1>CPO#: 623559</dealerinstructions1>
<dealerinstructions2>ATTN: DANA GRIFFIN</dealerinstructions2>
<dealerinstructions3>INFO: 612</dealerinstructions3>
<dealerinstructions4>ROUTE: ZNED UNTED</dealerinstructions4>
<dealerinstructions5 />
<dealerinstructions6 />
<shippingInstructionsIndicator>N</shippingInstructionsIndicator>
<shippingInstructions1 />
<shippingInstructions2 />
<shippingInstructions3 />
<shippingInstructions4 />
<shippingInstructions5 />
<shippingInstructions6 />
<specialInstructionsIndicator>N</specialInstructionsIndicator>
<specialInstructions1 />
<specialInstructions2 />
<customeContainerDesc />
- <carton>
<deliveryCartonID>253370905995</deliveryCartonID>
<shipIndicator>Y</shipIndicator>
<deliveryPalletID>X150</deliveryPalletID>
<consolidatedDeliveryCartonID />
<scanDateTime>2009-12-03T19:36:12.00</scanDateTime>
<cartonWeight>52</cartonWeight>
<dropShipFlag>1</dropShipFlag>
<carrierTrackingNumber />
<carrierZoneID>0</carrierZoneID>
<codAmount />
<customerPackageAmount />
<declaredValue />
<residentialDeliveryIndicator />
<serviceTypeCode>00</serviceTypeCode>
<ssccCode>006860244400829393</ssccCode>
- <Item>
<shipPrefix>UNV</shipPrefix>
<shipStockNumber>21200</shipStockNumber>
<itemDescription>PAPER XERO/DUP WE LTR 20#</itemDescription>
<orderQuantity>1</orderQuantity>
<originalShipQuantity>1</originalShipQuantity>
<shipQuantity>1</shipQuantity>
<inventoryUnitCode>CT</inventoryUnitCode>
<inventoryWeightQuantity>52.000</inventoryWeightQuantity>
<upcNumber>00000000000000</upcNumber>
<upcRetailCode>087547212004</upcRetailCode>
<hazmatIndicator>N</hazmatIndicator>
<serialRequiredIndicator>N</serialRequiredIndicator>
<dealerMemoPO>S</dealerMemoPO>
<cartonLineNumber>1</cartonLineNumber>
<orderLineNumber>11</orderLineNumber>
<originalOrderPrefix>UNV</originalOrderPrefix>
<originalOrderStockNumber>21200</originalOrderStockNumber>
<reasonCode />
- <Item_Serial>
<serialNumber />
</Item_Serial>
</Item>
</carton>
</order>
</Delivery>
</Shipment>
This is not the complete XML file as it exceeds the 15000 characters and then I cann't post here. So I have deleted much part of it.
The hierarchy is as following: Shipment->Delivery->Order->Carton->Item.
I have created a XSLT for it which is working fine.
But when I execute my report program it gives CX_SY_XSLT_FORMAT_ERROR saying that
Transformation error: Non-canonical structure of element name XML_OUTPUT.Dear experts,
My report program is as following:-
*& Report Z_ASNTRNS
REPORT Z_ASNTRNS.
*& Report Z_ASNTRNS
TYPE-POOLS: abap, ixml.
TABLES: ZASN_SHIPMENT,ZASN_DELIVERY,ZASN_ORDER,ZASN_CARTON,ZASN_ITEM.
*CONSTANTS gs_file TYPE string VALUE 'C:Documents and SettingsC5134126DesktopRajesh_kandakatlaSampleASNFile.xml'.
This is the structure for the data from the XML file
TYPES: BEGIN OF ts_item,
ZSHIPMENT LIKE ZASN_ITEM-ZSHIPMENT,
VBELN LIKE ZASN_ITEM-VBELN,
ORDER_NUMBER LIKE ZASN_ITEM-ORDER_NUMBER,
CARTON_ID LIKE ZASN_ITEM-CARTON_ID,
ITEM LIKE ZASN_ITEM-ITEM,
CARTON_LINE_NUM LIKE ZASN_ITEM-CARTON_LINE_NUM,
CARTON_LINE_NUMBER LIKE ZASN_ITEM-CARTON_LINE_NUM,
AEDAT(8),
AEZET(6),
ITEM_DESCRIPTION LIKE ZASN_ITEM-ITEM_DESCRIPTION,
ORD_QTY(16),
ORIGINAL_SHIP(16),
SHIP_QTY(16),
UPC_NUMBER LIKE ZASN_ITEM-UPC_NUMBER,
DEALER_MEMO_PO(5),
ORDER_LINE_NUM LIKE ZASN_ITEM-ORDER_LINE_NUM,
STATUS LIKE ZASN_ITEM-STATUS,
END OF ts_item.
TYPES: BEGIN OF ts_carton,
ZSHIPMENT LIKE ZASN_CARTON-ZSHIPMENT,
VBELN LIKE ZASN_CARTON-VBELN,
ORDER_NUMBER LIKE ZASN_CARTON-ORDER_NUMBER,
CARTON_ID LIKE ZASN_CARTON-CARTON_ID,
AEDAT(8),
AEZET(6),
SHIP_INDICATOR LIKE ZASN_CARTON-SHIP_INDICATOR,
TRACKING_NUMBER LIKE ZASN_CARTON-TRACKING_NUMBER,
ZZCARTON_WGT(18),
Item type ts_item,
END OF ts_carton.
TYPES: BEGIN OF ts_order,
ZSHIPMENT LIKE ZASN_ORDER-ZSHIPMENT,
VBELN LIKE ZASN_ORDER-VBELN,
ORDER_NUMBER LIKE ZASN_ORDER-ORDER_NUMBER,
AEDAT(8),
AEZET(6),
SUB_ORDER LIKE ZASN_ORDER-SUB_ORDER,
ORDER_DATE(8),
PRIMARY_ORDER LIKE ZASN_ORDER-PRIMARY_ORDER,
CUSTOMER_PO LIKE ZASN_ORDER-CUSTOMER_PO,
PRIMARY_ID LIKE ZASN_ORDER-PRIMARY_ID,
SHIP_TO LIKE ZASN_ORDER-SHIP_TO,
ANZPK(5),
carton type ts_carton,
END OF ts_order.
TYPES: BEGIN OF ts_delivery,
ZSHIPMENT LIKE ZASN_DELIVERY-ZSHIPMENT,
VBELN LIKE ZASN_DELIVERY-VBELN,
AEDAT(8) TYPE C,
AEZET(6) TYPE C,
PRIMARY_CUSTOMER LIKE ZASN_DELIVERY-PRIMARY_CUSTOMER,
BILL_OF_LADING LIKE ZASN_DELIVERY-BILL_OF_LADING,
CARTON_COUNT(5),
TOTAL_WEIGHT(18),
order type ts_order,
END OF ts_delivery.
TYPES: BEGIN OF ts_shipment,
ZSHIPMENT LIKE ZASN_SHIPMENT-ZSHIPMENT,
MANIFEST_DATE_TIME(25),
AEDAT(8) TYPE C,
AEZET(6) TYPE C,
SDATE(8) TYPE C,
STIME(6) TYPE C,
SFACILITY_NUMBER LIKE ZASN_SHIPMENT-SFACILITY_NUMBER,
ZZCARRIERCODE LIKE ZASN_SHIPMENT-ZZCARRIERCODE,
Delivery type ts_delivery,
END OF ts_shipment.
TYPES: BEGIN OF ts_shipment1,
ZSHIPMENT LIKE ZASN_SHIPMENT-ZSHIPMENT,
MANIFEST_DATE_TIME(25),
SFACILITY_NUMBER LIKE ZASN_SHIPMENT-SFACILITY_NUMBER,
ZZCARRIERCODE LIKE ZASN_SHIPMENT-ZZCARRIERCODE,
PRIMARY_CUSTOMER LIKE ZASN_DELIVERY-PRIMARY_CUSTOMER,
BILL_OF_LADING LIKE ZASN_DELIVERY-BILL_OF_LADING,
CARTON_COUNT(5),
TOTAL_WEIGHT(18),
ORDER_NUMBER LIKE ZASN_ORDER-ORDER_NUMBER,
SUB_ORDER LIKE ZASN_ORDER-SUB_ORDER,
ORDER_DATE(8),
PRIMARY_ORDER LIKE ZASN_ORDER-PRIMARY_ORDER,
CUSTOMER_PO LIKE ZASN_ORDER-CUSTOMER_PO,
PRIMARY_ID LIKE ZASN_ORDER-PRIMARY_ID,
SHIP_TO LIKE ZASN_ORDER-SHIP_TO,
CARTON_ID LIKE ZASN_CARTON-CARTON_ID,
SHIP_INDICATOR LIKE ZASN_CARTON-SHIP_INDICATOR,
TRACKING_NUMBER LIKE ZASN_CARTON-TRACKING_NUMBER,
ZZCARTON_WGT(18),
ITEM LIKE ZASN_ITEM-ITEM,
CARTON_LINE_NUM LIKE ZASN_ITEM-CARTON_LINE_NUM,
CARTON_LINE_NUMBER LIKE ZASN_ITEM-CARTON_LINE_NUM,
ITEM_DESCRIPTION LIKE ZASN_ITEM-ITEM_DESCRIPTION,
ORD_QTY(16),
ORIGINAL_SHIP(16),
SHIP_QTY(16),
UPC_NUMBER LIKE ZASN_ITEM-UPC_NUMBER,
DEALER_MEMO_PO(5),
ORDER_LINE_NUM LIKE ZASN_ITEM-ORDER_LINE_NUM,
END OF ts_shipment1.
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
*Typdefinition für Airplus
*READ THE DOCUMENTATION "LASG_XML_INVOICE_BTM"!!!
VARs beginning with "a_" are ATTRIBUTES
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_parser TYPE REF TO if_ixml_parser,
l_istream TYPE REF TO if_ixml_istream,
l_ostream TYPE REF TO if_ixml_ostream,
l_document TYPE REF TO if_ixml_document,
l_node TYPE REF TO if_ixml_node,
l_xml TYPE REF TO cl_xml_document,
l_xmldata TYPE string.
DATA: l_xml_table TYPE TABLE OF t_xml_line,
l_xml_line TYPE t_xml_line,
l_xml_table_size TYPE i.
DATA: l_filename TYPE string.
DATA: xml_out TYPE string ,
size type i.
DATA: l_xml_x1 TYPE xstring.
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce.
l_itab TYPE TABLE OF string.
DATA: BEGIN OF l_itab occurs 0,
data(256) type c,
end of l_itab.
TYPES : BEGIN OF TY_TEXT,
data(255) type C,
END OF TY_TEXT.
DATA: F_XML TYPE STRING.
DATA : LT_TEXT_OUT type table of TY_TEXT with header line.
tables
DATA: it_shipment TYPE STANDARD TABLE OF ts_shipment,
wa_shipment TYPE ts_shipment.
*Errorvariables
DATA: xslt_err TYPE REF TO cx_xslt_exception,
err_string TYPE string.
PARAMETERS: pa_file TYPE localfile OBLIGATORY
DEFAULT 'C:Documents and SettingsC5134126DesktopRajesh_kandakatlaSampleASNFile.xml'.
START-OF-SELECTION.
Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
here we use the CALL TRANSFORMATION method which calls
the XSLT program "z_asnfile"
TRY.
CALL TRANSFORMATION ('Z_ASNFILE')
SOURCE xml LT_TEXT_OUT[]
RESULT xml_output = it_shipment
catch any error, very helpful if the XSLT isn't correct
CATCH cx_xslt_exception INTO xslt_err.
err_string = xslt_err->get_text( ).
WRITE: / 'Transformation error: ', err_string.
EXIT.
ENDTRY." setting a breakpoint to watch the workarea
by the internal table "it_airplus"
break-point.
LOOP AT it_shipment INTO wa_shipment.
ENDLOOP.
*& Form get_xml_table
FORM get_xml_table CHANGING l_xml_table_size TYPE i
l_xml_table TYPE STANDARD TABLE.
l_filename = pa_file.
upload a file from the client's workstation
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = l_xml_table_size
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Convert binary to text.
CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
EXPORTING
INPUT_LENGTH = 70000
FIRST_LINE = 0
LAST_LINE = 0
APPEND_TO_TABLE = ' '
MIMETYPE = ' '
WRAP_LINES = 'X'
IMPORTING
OUTPUT_LENGTH =
TABLES
BINARY_TAB = l_xml_table
TEXT_TAB = LT_TEXT_OUT
EXCEPTIONS
FAILED = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "get_xml_table -
How to select columns from internal table using 'GUI_DOWNLOAD' ?
Hi,
i am running a report & the fields for output is saved in an internal table which has as many as 10 fields. But I want to select only a few fields for output. There is a option COL_SELECT in function 'GUI_DOWNLOAD'. How to use it. If possible with example.Hai VijayKumar
Try with the following code
tables : mara.
data : begin of it_mara occurs 0,
matnr like mara-matnr,
mbrsh like mara-mbrsh,
mtart like mara-mtart,
meins like mara-meins,
end of it_mara.
parameters : P_mtart like mara-mtart default 'ROH'.
start-of-selection.
perform select_data.
perform download_data.
*& Form select_data
text
--> p1 text
<-- p2 text
FORM select_data .
select
matnr
mbrsh
mtart
meins
from mara into table it_mara
where mtart = p_mtart.
ENDFORM. " select_data
*& Form download_data
text
--> p1 text
<-- p2 text
FORM download_data .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'c:\down.txt'
FILETYPE = 'ASC'
COL_SELECT = 'X'
COL_SELECT_MASK = 'X XX'
TABLES
DATA_TAB = it_mara.
IF SY-SUBRC = 0.
SORT IT_MARA BY MATNR.
ENDIF.
ENDFORM. " download_data
Thanks & Regards
Sreenivasulu P
Maybe you are looking for
-
How to add a field in sales order header
Hi all, I need to add a custom field say a check box in sales order header in additional data B tab. let me know step by step. Points will be rewarded. Thanks. Ramya
-
In Material Master creation (MM01) organizational levels tab.
Hi, In the transaction MM01 after selecting the views i choose the organizational levels for selecting the plant and the storage location, But here i am not able to see the plant field, and only storage location filed is there for me to key in the da
-
Firefighter log report does not show programs executed under SA38/SE38
We are on version 400_700 of Compliance Calibrator. When executing the log report, the report name only shows "RFC". We are testing SA38 & SE38. I expected the report to display the program name. Is there something set up wrong or are my expectat
-
Need Guidance inMapping 2 BI systems to 1 R/3 system
Dear team, In our organization we have the following data pulling landscape, R/3 --> BI --> SEM Data is pulled from R/3 to BI and then to SEM. As we dont use few cubes in BI but still in SEM anyhow the data is loaded in to BI and then
-
How to define ASM failure groups!
Hi all, I have 4 disk on both disk controller SATA controller ASMDISKO1 ASMDISKP1 SCSI controller ASMDISKR1 ASMDISKS1 I created diskgroup test as below: CREATE DISKGROUP TEST EXTERNAL REDUNDANCY FAILGROUP controller1 DISK 'ORCL:ASMDISKO1', 'ORCL:ASMD