ABAP-BDC & ALV
HI
I WANTED TO KNOW ABOUT A GOOD BOOK ON ABAP-BDC & ALV WHICH IS AVAILABLE IN INDIA.ALSO WOULD LIKE TO KNOW WHERE IN INDIA WILL I GET THE BOOK PLEASE.
Hi Vipul,
Some of the books that gives a well explanation from the basic concepts are the following :
1) Sams Teach Yourself ABAP/4 in 21 Days by Ken Greenwood
2) The ABAP Quick Reference by H. Keller
You can also catch on the Code samples and Forum threads on SDN which will cater you a more advanced programming knowledge.
Thanks and Regards,
Siva
Similar Messages
-
Abap WD ALV: Event for calculation row?
Hi,
i have one Abap WebDynpro ALV Component. It is possible to register an event (ON_CLICK) for Cells which are an Link_to_action for example.
My Table:
ID | Group | Var
A1 | Test | 4
A2 | Test | 5
A3 | Dev | 4
A4 | Dev | 6
If i create the ON_CLICK event for the last row, which is then a link_to_action column, i can click on the numbers and the event is triggered
Now i have a table which uses the ALV Calculation feature and the Intermediate Results for the grouping.
My new output view is:
ID | Group | Var
->---Test 9
A1 | Test | 4
A2 | Test | 5
->---Dev 10
A3 | Dev | 4
A4 | Dev | 6
(It calculates the sum of the vars and groups it by the second column)
Now I need an Event if someone clicks on the numbers in the Var Row of the intermediate results row (here: 9 and 10). How can i do this?
If this is not possible, how can i register an event if someone expands or collapses a intermediate result row?
Kind Regards,
Thomas
Edited by: Thomas Rodemer on Oct 9, 2008 3:30 PM
Edited by: Thomas Rodemer on Oct 9, 2008 3:30 PMHi,
Is the DDLBK is filled with support function? if yes then look if you can enhance the method by post method exit etc..
Thanks,
Chandra -
Adding buttons in ABAP WD ALV toolbar
Hi,
Currently, on the ABAP WD ALV grid toolbar, there are the "Excel" and "Print Version" buttons by default.
I would like to know how can I add my own custom buttons to the toolbar (or remove the default ones)? I've looked in the documentation, but I can't seem to find any examples.
Thank you in advance for your help,
ChristianHi Christian,
use Interface IF_SALV_WD_STD_FUNCTIONS. There are a few methods included to control the buttons on the
tool bar, e.g. SET_PDF_ALLOWED or SET_EDIT_DELETE_ROW_ALLOWED.
Use the ALV configuration model to control this. There are a couple of tutorials available on SDN on how to implement it. Just do a search.
regards, Ulli -
1.How can we change the language setting while uploading BDC?
2.How can we add a push button to the ALV report?
3. What is SQL Trace, how would you carried out performance analysis of ABAP code Using SQL Trace? Give the steps?Hi
SQL Trace transaction ST05: The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on a particular database table of the ABAP program would be mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
SQL Trace ST05
Starting the Trace:
To analyze a trace file, do the following:
Choose the menu path Test  Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
If you want to switch on the trace under your user name, choose Trace on. If you want to pass on values for one or several filter criteria, choose Trace with Filter. Typical filter criteria are: the name of the user, transaction name, process name, and program name.
Now run the program to be analyzed.
Stopping the Trace:
To deactivate the trace:
Choose Test Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
Select the trace functions that you want to switch off.
Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
Analyzing a Sample trace data:
PREPARE: Prepares the OPEN statement for use and determines the access method.
OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.
FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area. -
Conversion of the ABAP Report (ALV based) into BSP Application
Hello Friends,
I tried to convert the abap report into a bsp application. I have followed all the steps mentoined in the previous threads regarding this topic.
I have created a simple Z report in CRM, that displays the business partner details from the table BUT000 based on the partner entered. Partner is the input given to this report. I have defined the partner field in PARAMETERS.
Now I have written all the code in the onInitialization of the BSP Page looking at the previous threads and also in the layout of the page.
submit ZTEST_PARTNER
exporting list to memory and return
with p_part = 'HR10079430'.
and also the rest of the code.
It is working fine. The BSP page is displayed with all the Business Partner details.
Now the problem is I have another Z report that displays the result in the ALV grid. The report uses the Function Module REUSE_ALV_GRID_DISPLAY to display the output.
If I use the same method above this is giving a dump, I mean it says the page cannot be displayed.
So, how should I use the above method to convert the ALV Grid based Z report into a BSP Application.
Please give your suggestions.
Thanks & Regards,
Raju.you cannot .
even if you use a normal report to
submit the alv grid report
exporting list to memory and return
it will show the alv on screen and will nt just export the list to memory. -
ABAP - BDC transaction not saving changes to records
I am trying to write my first ABAP code using BDC recording. Essentially I would like to flag the "Final Delivery" field (EKPO-EGLKZ) for a range of documents by recording transaction MASS.
The code runs without errors - but the changes are not saved. I have run the code in "Processing Mode: A" (Display all screens) and the program successfully loops through each record & saves the updated fields. When I look at the documents in ME23N the changes have not been saved. Running the MASS transaction manually results in the changes being successfully saved so I can rule out any data validation issues.
Does anyone know why the changes refuse to save when running the code below?
I have considered trying to use BAPI_PO_CHANGE instead of BDC, but I am new to ABAP and I thought the BDC code would be less complex.
report Z_MASS_REMOVE_FDI_DCI
no standard page heading line-size 255.
include bdcrecx1.
TYPES: BEGIN OF ty_tab,
MASSOBJTYP(7),
MASSVARNAM(7),
DOCNO(9),
ITEM(1),
END OF ty_tab.
DATA : it_tab TYPE STANDARD TABLE OF ty_tab.
DATA : wa_tab TYPE ty_tab.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'X:\STO.TXT'
* FILETYPE = 'ASC
has_field_separator = 'X'
TABLES
data_tab = it_tab
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.
END-OF-SELECTION.
LOOP AT it_tab INTO wa_tab.
WRITE:/ wa_tab-MASSOBJTYP,
wa_tab-MASSVARNAM,
wa_tab-DOCNO,
wa_tab-ITEM.
PERFORM open_group.
perform bdc_dynpro using 'SAPMMSDL' '0100'.
perform bdc_field using 'BDC_CURSOR'
'MASSSCREEN-OBJECT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MASSSCREEN-OBJECT'
wa_tab-MASSOBJTYP.
perform bdc_field using 'MASSSCREEN-VARNAME'
wa_tab-MASSVARNAM.
perform bdc_dynpro using 'SAPMMSDL' '0100'.
perform bdc_field using 'BDC_CURSOR'
'MASSSCREEN-OBJECT'.
perform bdc_field using 'BDC_OKCODE'
'=NEXT'.
perform bdc_dynpro using 'SAPLMASS_SEL_DIALOG' '0100'.
perform bdc_field using 'BDC_CURSOR'
'MASSFREESEL-LOW(01)'.
perform bdc_field using 'MASSFREESEL-LOW(01)'
wa_tab-DOCNO.
perform bdc_dynpro using 'SAPLMASS_SEL_DIALOG' '0100'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MASSFREESEL-LOW(02)'.
perform bdc_field using 'MASSFREESEL-LOW(02)'
wa_tab-ITEM.
perform bdc_dynpro using 'SAPLMASS_SEL_DIALOG' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=CRET'.
perform bdc_field using 'BDC_CURSOR'
'MASSFREESEL-LOW(01)'.
perform bdc_dynpro using 'SAPLMASSINTERFACE' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=FDAE'.
perform bdc_field using 'BDC_CURSOR'
'NR_ITEMS'.
perform bdc_dynpro using 'SAPLMASSINTERFACE' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field using 'BDC_CURSOR'
'NR_ITEMS'.
perform bdc_dynpro using 'SAPLMASSMSGLIST' '0300'.
perform bdc_field using 'BDC_CURSOR'
'REOML-MSGTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=EXIT'.
perform bdc_transaction using 'MASS'.
ENDLOOP.
PERFORM close_group.Where is BDC_INSERT.
If u use OPEN and CLOSE_group u need to use INSERT_GROUP also to update in database.
A session will be created and u nedd to run the Session in Sm35 in order to update the database.
Edited by: Ranjith Kumar on Sep 18, 2008 6:41 AM -
ABAP Query - ALV Grid Calculation
Can anybody tell me whether in ABAP Query when you execute the Query in SQ01 its shows the report in ALV Grid format. In ALV Grid format there are some standard calculation are available like
TOtal
Mean value
Minmum
Maximum
Count
The above calculation can be done for each column.
My Query is it possible to put our own simple calculation
through some coding for overall summation fields instead of this std. calculation.
Example : Unrestricted moved Qty Summation divided by INspection lot qty summation * 100
The output of this calculation is called First pass yield.
This calculation i done for each line item by creating a Additional field with ABAP coding.The overall meanvalue calcualtion of this addtional fields column is not suits the customer expectation.They want the calculation to be done by the system like what i had explained in the example.Hi,
Here is a code for a single grid.
In the screen layout,make a custom container (Icon with C ) and name it in Capital letters as CONTAINER.The code below in bold letters is what exactly you want.I ve given a small example on how to use ALV:
REPORT SAMPLE.
DATA: alv type ref to cl_gui_alv_GRID,
cont type ref to cl_gui_custom_container,
itab_spfli type table of spfli.
START-OF-SELECTION.
select * from spfli into table itab_spfli.
call screen 100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
seT PF-STATUS 'GUI'.
SET TITLEBAR 'xxx'.
if cont is initial.
CREATE OBJECT cont
EXPORTING
CONTAINER_NAME = 'CONTAINER'.
CREATE OBJECT ALV
EXPORTING
I_PARENT = CONT.
CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'SPFLI'
CHANGING
IT_OUTTAB = itab_spfli
Now for your requirement,you can create two custom containers in the screen layout and two different alv grid instances.ie:
DATA: alv1 type ref to cl_gui_alv_GRID,
cont1 type ref to cl_gui_custom_container
alv2 type ref to cl_gui_alv_GRID,
cont2 type ref to cl_gui_custom_container.
To select data from first grid,you can use events on double_click and fetch information and then display it in the second grid.
<b>SOME MATERIAL REGARDING ALV:</b>
www.abap4.it/download/ALV.pdf <b>(very useful)</b>
http://www.sapdevelopment.co.uk/reporting/alvhome.htm
<b>-->download the PDF from following link.</b>
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm
<b>SAMPLE PROGRAMS IN ALV:</b>http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid
<b>DEMO PROGRAMS IN ALV:</b>BCALV*
Regards,
Beejal
**Reward if this helps -
Morning Experts,
in ALV interactive report using objects and methods , i have developed a report using an event 'double_click'.
but in the output,the secondary list is displayed when i double-click on any field in a particular record of basic list.
but i would like to display secondary list when i double_click on a particular field of basic list.
can anybody help me out.
regards,
yateendra.hi,
Refer to this link ,
http://www.sap-img.com/abap/an-interactive-alv-report.htm
reward pts if helpfull.
Regards,
Dhan -
Oo abap Display ALV with all selected lines
I will have to display an ALV report but all the records have to be selected while displaying.
I have to do this using OO ABAP only.
Thanks
KiranSolved on my own
-
Re:BDC,ALV,SCRIPTS and SMARTFORMS
Hi,
i need a complete BDC programming example codes with different methods, suppose if it is a material master mm01, i need the screen shots, what to fill in that transaction , the flat file data snapshot and program, so that i will do that example, otherwise iam so much confused
I also need ALV ,SAPSCRIPTS and smartforms realtime sample codes with screenshots so tht i will try directly .
Iam very thankful to all of them who helps me
Thanks & Regards,
Sravanthigopal
[email protected]** Program ID : ZMAT_CREATE
** Program Desc : Material Master Creation
** Process Overview
** Created Date : 22/08/2006
** Company Name :
REPORT ZMAT_CREATE
NO STANDARD PAGE HEADING LINE-SIZE 132 MESSAGE-ID ZBDCMSG.
Internal table definition *
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE RMMG1-MATNR, " Material Number
MBRSH LIKE RMMG1-MBRSH, " Industry Sector
MTART LIKE RMMG1-MTART, " Material Type
WERKS LIKE RMMG1-WERKS, " Plant
LGORT LIKE RMMG1-LGORT, " Storage Location
VKORG LIKE RMMG1-VKORG, " Sales Organization
VTWEG LIKE RMMG1-VTWEG, " Distribution Channel
LGNUM LIKE RMMG1-LGNUM, " Warehouse Number
LGTYP LIKE RMMG1-LGTYP, " Storage Type
MAKTX LIKE MAKT-MAKTX, " Material Description
MEINS LIKE MARA-MEINS, " Base Unit of Measure
MATKL LIKE MARA-MATKL, " Material Group
SPART LIKE MARA-SPART, " Division
MTPOS_MARA LIKE MARA-MTPOS_MARA, "General item category group
GEWEI LIKE MARA-GEWEI, " Weight Unit
TAXKM1 LIKE MG03STEUER-TAXKM, " Tax classification material
TAXKM2 LIKE MG03STEUER-TAXKM, " Tax classification material
KONDM LIKE MVKE-KONDM, " Material Pricing Group
MTPOS LIKE MVKE-MTPOS , "ItemCategoryGroupFromMaterialMaster
MTVFP LIKE MARC-MTVFP, " Checking Group for AvailabilityCheck
TRAGR LIKE MARA-TRAGR, " Transportation group
LADGR LIKE MARC-LADGR, " Loading group
TDLINE LIKE RSTXT-TXLINE, " Text editor text line
EKGRP LIKE MARC-EKGRP, " Purchasing Group
DISMM LIKE MARC-DISMM, " MRP Type
BESKZ LIKE MARC-BESKZ, " Procurement Type
SOBSL LIKE MARC-SOBSL, " Special procurement type
PERKZ LIKE MARC-PERKZ, " Period indicator
PRMOD LIKE MPOP-PRMOD, " Forecast model
KZINI LIKE MPOP-KZINI, " Initialization indicator
AUTRU LIKE MARC-AUTRU, " Reset Forecast Model Automatically
MODAV LIKE MPOP-MODAV, " Model selection procedure
IPRKZ LIKE MARA-IPRKZ, " Period indicator for shelf life expiration date
BWTTY LIKE MBEW-BWTTY, " Valuation Category
BKLAS LIKE MBEW-BKLAS, " Valuation Class
EKLAS LIKE MBEW-EKLAS, " Valuation Class for Sales OrderStock
VPRSV LIKE MBEW-VPRSV, " Price Control Indicator
EKALR LIKE MBEW-EKALR, "MaterialIsCostedWithQuantityStructure
END OF ITAB,
*// TEXT HEADER
GT_HEAD LIKE THEAD,
*// Text lines
GT_TEXT LIKE STANDARD TABLE OF TLINE,
GW_TEXT LIKE TLINE,
Data definition *
WS_REP_CNT(6) TYPE C,
SESSION(12) TYPE C.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
PARAMETERS:
PA_GROUP LIKE APQI-GROUPID OBLIGATORY DEFAULT 'MMupload',
PA_FNAME LIKE IBIPPARMS-PATH OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
Include statements *
INCLUDE ZBDCREX.
At Selection Screen definition *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PA_FNAME.
*//GETTING FLAT FILE PATH
PERFORM FILE_PATH USING PA_FNAME.
Start of Selection definition *
START-OF-SELECTION.
*//UPLOADING THE FLAT FILE
PERFORM DATA_UPLOAD TABLES ITAB USING PA_FNAME.
*// BDC OPEN GROUP
PERFORM OPEN_GROUP USING PA_GROUP.
SKIP 3.
FORMAT COLOR COL_HEADING INVERSE ON.
WRITE 40 TEXT-001.
FORMAT COLOR COL_HEADING INVERSE OFF.
SKIP 1.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE :/3 TEXT-002, 13 SY-MANDT, 104 TEXT-003, 113 SY-UNAME,
/3 TEXT-004, 13 SY-DATUM, 104 TEXT-005, 113 SY-UZEIT.
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
LOOP AT ITAB.
WS_REP_CNT = WS_REP_CNT + 1. "To Count no. of Records Processed
PERFORM MM_UPLOAD.
ENDLOOP.
*//STATUS INDICATION
IF SY-SUBRC = 0.
SESSION = PA_GROUP.
SKIP 1.
FORMAT COLOR COL_TOTAL INVERSE ON.
WRITE: /38 TEXT-006 , WS_REP_CNT.
FORMAT COLOR COL_TOTAL INVERSE OFF.
MESSAGE S000 WITH SESSION.
ENDIF.
*// BDC CLOSE GROUP
PERFORM CLOSE_GROUP.
SET PF-STATUS 'ZMM01PF'.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'SESSION'.
CALL TRANSACTION 'SM35'.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE SCREEN.
ENDCASE .
FORM MM_UPLOAD *
FORM MM_UPLOAD.
REFRESH BDCDATA.
*// Create Material: Initial Screen
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-MATNR'
ITAB-MATNR.
perform bdc_field using 'RMMG1-MBRSH'
ITAB-MBRSH.
perform bdc_field using 'RMMG1-MTART'
ITAB-MTART.
*// Selection Views
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'SELA'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
*// Organization Levels
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
ITAB-WERKS.
perform bdc_field using 'RMMG1-LGORT'
ITAB-LGORT.
perform bdc_field using 'RMMG1-VKORG'
ITAB-VKORG.
perform bdc_field using 'RMMG1-VTWEG'
ITAB-VTWEG.
perform bdc_field using 'RMMG1-LGNUM'
ITAB-LGNUM.
perform bdc_field using 'RMMG1-LGTYP'
ITAB-LGTYP.
*// Basic Data 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=SP04'.
perform bdc_field using 'MAKT-MAKTX'
ITAB-MAKTX.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARA-SPART'
ITAB-SPART.
perform bdc_field using 'MARA-MTPOS_MARA'
ITAB-MTPOS_MARA.
perform bdc_field using 'BDC_CURSOR'
'MARA-GEWEI'.
perform bdc_field using 'MARA-BRGEW'
'9000'.
perform bdc_field using 'MARA-GEWEI'
ITAB-GEWEI.
perform bdc_field using 'MARA-NTGEW'
'8000'.
*// Sales: Sales Organization 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP05'.
perform bdc_field using 'MG03STEUER-TAXKM(01)'
ITAB-TAXKM1.
perform bdc_field using 'MG03STEUER-TAXKM(02)'
ITAB-TAXKM2.
perform bdc_dynpro using 'SAPLMGMM' '4200'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_OKCODE'
'=SP05'.
*// Sales: Sales Organization 2: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP06'.
perform bdc_field using 'BDC_CURSOR'
'MVKE-KONDM'.
perform bdc_field using 'MVKE-KONDM'
ITAB-KONDM.
perform bdc_field using 'MARA-MTPOS_MARA'
ITAB-MTPOS_MARA.
perform bdc_field using 'MVKE-MTPOS'
ITAB-MTPOS.
*// Sales: General / Plant Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP12'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARA-BRGEW'
'9000'.
perform bdc_field using 'MARA-GEWEI'
ITAB-GEWEI.
perform bdc_field using 'MARA-XCHPF'
perform bdc_field using 'MARA-NTGEW'
'8000'.
perform bdc_field using 'MARC-MTVFP'
ITAB-MTVFP.
perform bdc_field using 'BDC_CURSOR'
'MARC-LADGR'.
perform bdc_field using 'MARA-TRAGR'
ITAB-TRAGR.
perform bdc_field using 'MARC-LADGR'
ITAB-LADGR.
*// MRP 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP13'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARC-EKGRP'
ITAB-EKGRP.
perform bdc_field using 'BDC_CURSOR'
'MARC-DISMM'.
perform bdc_field using 'MARC-DISMM'
ITAB-DISMM.
*// MRP 2: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP14'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1_BEZ-WERKS_BEZ'.
perform bdc_field using 'MARC-BESKZ'
ITAB-BESKZ.
perform bdc_field using 'MARC-SOBSL'
ITAB-SOBSL .
*// MRP 3: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP16'.
perform bdc_field using 'BDC_CURSOR'
'MARC-PERKZ'.
perform bdc_field using 'MARC-PERKZ'
ITAB-PERKZ.
perform bdc_field using 'MARC-MTVFP'
ITAB-MTVFP.
*// Forecasting Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP17'.
perform bdc_field using 'BDC_CURSOR'
'MPOP-PRMOD'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MPOP-PRMOD'
ITAB-PRMOD.
perform bdc_field using 'MARC-PERKZ'
ITAB-PERKZ.
perform bdc_field using 'MPOP-PERAN'
'60'.
perform bdc_field using 'MPOP-ANZPR'
'12'.
perform bdc_field using 'MPOP-KZINI'
ITAB-KZINI.
perform bdc_field using 'MPOP-SIGGR'
'4.000'.
perform bdc_field using 'MARC-AUTRU'
ITAB-AUTRU.
perform bdc_field using 'MPOP-MODAV'
ITAB-MODAV.
*// Work Scheduling Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP19'.
perform bdc_field using 'BDC_CURSOR'
'MARC-FRTME'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
*// Plant data / Stor. 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP20'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARA-IPRKZ'
ITAB-IPRKZ.
*// Plant data / Stor. 2: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP21'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-BRGEW'
'9000'.
perform bdc_field using 'MARA-GEWEI'
ITAB-GEWEI.
perform bdc_field using 'MARA-NTGEW'
'8000'.
*// Warehouse Management 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP23'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MARA-BRGEW'
'9000'.
perform bdc_field using 'MARA-GEWEI'
ITAB-GEWEI.
*// Quality Management Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP24'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
*// Accounting 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP26'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MBEW-BWTTY'
ITAB-BWTTY.
perform bdc_field using 'MARA-SPART'
ITAB-SPART.
perform bdc_field using 'BDC_CURSOR'
'MBEW-STPRS'.
perform bdc_field using 'MBEW-BKLAS'
ITAB-BKLAS.
perform bdc_field using 'MBEW-EKLAS'
ITAB-EKLAS.
perform bdc_field using 'MBEW-VPRSV'
ITAB-VPRSV.
perform bdc_field using 'MBEW-PEINH'
'1'.
perform bdc_field using 'MBEW-VERPR'
'800'.
perform bdc_field using 'MBEW-STPRS'
'800'.
*// Costing 1: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=SP27'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MARA-MEINS'
ITAB-MEINS.
perform bdc_field using 'MBEW-EKALR'
ITAB-EKALR.
perform bdc_field using 'MARC-LOSGR'
'1'.
*// Costing 2: Screen
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=BABA'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MBEW-BKLAS'
ITAB-BKLAS.
perform bdc_field using 'MBEW-BWTTY'
ITAB-BWTTY.
perform bdc_field using 'MBEW-EKLAS'
ITAB-EKLAS.
perform bdc_field using 'MBEW-VPRSV'
ITAB-VPRSV.
perform bdc_field using 'MBEW-PEINH'
'1'.
perform bdc_field using 'MBEW-VERPR'
'800.00'.
perform bdc_field using 'MBEW-STPRS'
'800.00'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
*//BDC INSERT
PERFORM BDC_TRANSACTION TABLES BDCDATA
USING 'MM01'. " MESSAGES INTO GT_MSG.
*// Text Header Data
CONCATENATE ITAB-MATNR ' 000101'
INTO GT_HEAD-TDNAME .
GT_HEAD-TDOBJECT = 'MVKE' .
GT_HEAD-TDID = '0001' .
GT_HEAD-TDSPRAS = SY-LANGU.
*// Sales Text
GW_TEXT-TDFORMAT = '00'.
GW_TEXT-TDLINE = ITAB-TDLINE .
APPEND GW_TEXT TO GT_TEXT.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = GT_HEAD
INSERT = 'X'
SAVEMODE_DIRECT = 'X'
OWNER_SPECIFIED = ' '
TABLES
LINES = GT_TEXT
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
SKIP 2.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE: / 'Unable to Insert Salestext for Material : ', ITAB-MATNR .
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
ENDIF.
CLEAR: GT_HEAD, GT_TEXT, GW_TEXT.
ENDFORM. "MM_UPLOAD
** Program ID : ZMAT_CREATE
** Program Desc : Material Master Creation Using BAPI
** Process Overview :
** Created By : P.KARTHIKEYAN
** Created Date : 17/08/2006
** Company Name : Infoview Technologies Limited
REPORT ZBAPI_MATERIAL_SAVETEXT LINE-SIZE 132 MESSAGE-ID ZMMBAPI.
*<<<DATA DECLEA FOR HEADER>>>>>>>>>>>>>>>>>>>>>>>>>>>>
****<<<<<Header segment with control information>>>>>>
DATA: HEADER LIKE BAPIMATHEAD.
*<<CLIENT DATA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*<<<<<<<<Client-specific material data>>>>>>>>>>>>>>>>
DATA: GT_CLIENTDATA LIKE BAPI_MARA.
**<<<<<<<<CLIENT DATA INITIAL>>>>>>>>>>>>>
**<<<<<<<<Information on update for CLIENTDATA>>>>>>>>
DATA: GT_CLIENTDATAX LIKE BAPI_MARAX.
***<<<<<PLANTDATA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
**<<<<<<<Plant-specific material data>>>>>>>>>>>>>>>>>
DATA: GT_PLANTDATA LIKE BAPI_MARC.
**<<<<<<<<PLANT DATA INITIAL>>>>>>>>>>>>>>>
**<<<<<<<<Information on update for PLANTDATA>>>>>>>>
DATA:GT_PLANTDATAX LIKE BAPI_MARCX.
*<<<<<<<<<<<<<<<FORECASTPARAMETERS>>>>>>>>>>>>>>>>>>>
DATA: GT_FORECASTPARAMETERS LIKE BAPI_MPOP.
*<<<<<<<<<<<<<Information on update for FORECASTDATA>
*<<<<<<<<<<<<<<<FORECASTPARAMETERS DATA INTIAL>>>>>>>
DATA:GT_FORECASTPARAMETERSX LIKE BAPI_MPOPX.
*<<<<<<<<<<<<<<<PLANNING DATA >>>>>>>>>>>>>>>>>>>>>>
*<<<<<<<<<<<Information on update for PLANNINGDATA>>>
DATA:GT_PLANNINGDATA LIKE BAPI_MPGD.
*<<<<<<<<<<<<<<<PLANNING INITIAL >>>>>>>>>>>>>>>>>>>
DATA:GT_PLANNINGDATAX LIKE BAPI_MPGDX.
*<<<<<<<<<<<<<<<STORAGELOCATIONDATA>>>>>>>>>>
*<<<<<<<<<<<<Storage-location-specific material data>>
DATA: GT_STORAGELOCATIONDATA LIKE BAPI_MARD.
*<<<<<<Information on update for STORAGELOCATIONDATA>>
*<<<<<<<<<<<<<<<STORAGELOCATIONDATA INITIAL>>>>>>>>>>>
DATA:GT_STORAGELOCATIONDATAX LIKE BAPI_MARDX.
*<<<<<<<<<<<<<<<SALESDATA DATA >>>>>>>>>>>>>>>>>>>>>
DATA: GT_SALESDATA LIKE BAPI_MVKE.
*<<<<<<<<<<<<<<<Information on update for SALESDATA>>>
*<<<<<<<<<<<<<<<SALESDATA DATA INITIAL >>>>>>>>>>>>>>
DATA: GT_SALESDATAX LIKE BAPI_MVKEX.
****<<<<<<<<<<<<Units of measure>>>>>>>>>>>>>>>>>>>>>>>
*****<<<<<<<<<<<<<<<GT_UNITSOFMEASURE>>>>>>>>>>>>>>>>>>
DATA: GT_UNITSOFMEASURE LIKE BAPI_MARM OCCURS 0 WITH HEADER LINE.
*****<<<<<<<<<<<<<<<GT_UNITSOFMEASUREX>>>>>>>>>>>>>>>>>
DATA: GT_UNITSOFMEASUREX LIKE BAPI_MARMX OCCURS 0 WITH HEADER LINE.
*****<<<<<<<<<<<<<<<SALES TEXT>>>>>>>>>>>>>>>>>>>>>>>>>>
DATA: GT_MATERIALLONGTEXT LIKE BAPI_MLTX OCCURS 0 WITH HEADER LINE.
*****<<<<<<<<<<<<<<<MATERIAL_DESC>>>>>>>>>>>>>>>>>>>>>>>>>>
DATA: MATERIAL_DESC LIKE BAPI_MAKT OCCURS 0 WITH HEADER LINE.
*******<<<<<<<RETURN PARAMETERS>>>>>>>>
DATA: ITAB_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE. "#EC NEEDED
******<<<<<<<WAREHOUSENUMBERDATA>>>>>>>>>>>>>>
DATA: GT_WAREHOUSENUMBERDATA LIKE BAPI_MLGN.
******<<<<<<<WAREHOUSENUMBERDATA>>>>>>>>>>>>>>
DATA: GT_WAREHOUSENUMBERDATX LIKE BAPI_MLGNX.
******<<<<<<<STORAGETYPEDATA>>>>>>>>>>>>>>>>>>
DATA: GT_STORAGETYPEDATA LIKE BAPI_MLGT.
******<<<<<<<STORAGETYPEDATAX>>>>>>>>
DATA: GT_STORAGETYPEDATAX LIKE BAPI_MLGTX.
***<<<BAPI_TRANSCATION COMMIT>>>>>>>>>>>>>>>>>
DATA: GT_RETURN TYPE BAPIRET2. "#EC NEEDED
***<<<<<<<<Valuation data>>>>>>>>>>>>>>>>>>>>>
DATA: GT_VALUATIONDATA like BAPI_MBEW. "Valuation data
***<<<<<<<<Valuation data>>>>>>>>>>>>>>>>>>>>>
DATA: GT_VALUATIONDATAX like BAPI_MBEWX. "Valuation data
data: gt_PRTDATA like BAPI_MFHM OCCURS 0 WITH HEADER LINE.
data: gt_PRTDATAX like BAPI_MFHM OCCURS 0 WITH HEADER LINE.
**<<<<International Article Numbers (EANs)>>>>
DATA: GT_INTERNATIONALARTNOS LIKE BAPI_MEAN OCCURS 0 WITH HEADER LINE,
**<<<<Tax classifications>>>>>>>>>>>>>>>>>>>>>>
GT_TAXCLASSIFICATIONS LIKE BAPI_MLAN OCCURS 0 WITH HEADER LINE,
GT_RETURNMESSAGES LIKE BAPI_MATRETURN2 OCCURS 0 WITH HEADER LINE.
**<<<<<<<<<<<<<<FLAT FILE INTERNAL TABLE USED FOR DOWNLOAD EXCEL FILE>>>>>>
DATA: BEGIN OF GT_FT_ITAB OCCURS 0,
MATERIAL TYPE BAPIMATHEAD-MATERIAL , "Material Number
IND_SECTOR TYPE BAPIMATHEAD-IND_SECTOR, "Industry Sector
MATL_TYPE TYPE BAPIMATHEAD-MATL_TYPE , "Material Type
BASIC_VIEW TYPE BAPIMATHEAD-BASIC_VIEW, "Basic Data View
SALES_VIEW TYPE BAPIMATHEAD-SALES_VIEW , "Sales View
PURCHASE_VIEW TYPE BAPIMATHEAD-PURCHASE_VIEW, "Purchasing View
MRP_VIEW TYPE BAPIMATHEAD-MRP_VIEW ,"Material Requirements Planning (MRP) View
FORECAST_VIEW TYPE BAPIMATHEAD-FORECAST_VIEW , "Forecasting View
WORK_SCHED_VIEW TYPE BAPIMATHEAD-WORK_SCHED_VIEW ,"Work Scheduling View
PRT_VIEW TYPE BAPIMATHEAD-PRT_VIEW , "Production Resources/Tools (PRT) View
STORAGE_VIEW TYPE BAPIMATHEAD-STORAGE_VIEW , "Storage View
WAREHOUSE_VIEW TYPE BAPIMATHEAD-WAREHOUSE_VIEW , "Warehouse Management View
QUALITY_VIEW TYPE BAPIMATHEAD-QUALITY_VIEW, "Quality Management View
ACCOUNT_VIEW TYPE BAPIMATHEAD-ACCOUNT_VIEW , "Accounting View
COST_VIEW TYPE BAPIMATHEAD-COST_VIEW , "Costing View
*****<<<<<<<<CLIENT DATA>>>>>>>>>>>>>>>>>>>>
MATL_GROUP TYPE BAPI_MARA-MATL_GROUP, "Materialgroup
OLD_MAT_NO TYPE BAPI_MARA-OLD_MAT_NO, "Old material number
BASE_UOM TYPE BAPI_MARA-BASE_UOM, "Base Unit of Measure
BASE_UOM_ISO TYPE BAPI_MARA-BASE_UOM_ISO ,"Base unit of measure in ISO code
DOCUMENT TYPE BAPI_MARA-DOCUMENT, "Document number
DOC_TYPE TYPE BAPI_MARA-DOC_TYPE, "Document type
DOC_VERS TYPE BAPI_MARA-DOC_VERS, "Document version
DOC_FORMAT TYPE BAPI_MARA-DOC_FORMAT,"Page format of document
DOC_CHG_NO TYPE BAPI_MARA-DOC_CHG_NO, "Document change number
PAGE_NO TYPE BAPI_MARA-PAGE_NO, "Page number of document
PROD_MEMO TYPE BAPI_MARA-PROD_MEMO , "Production/Inspection Memo
PAGEFORMAT TYPE BAPI_MARA-PAGEFORMAT, "Page Format of Production Memo
SIZE_DIM TYPE BAPI_MARA-SIZE_DIM, "Size/dimensions
BASIC_MATL TYPE BAPI_MARA-BASIC_MATL, "Basic Material
STD_DESCR TYPE BAPI_MARA-STD_DESCR, "Industry Standard Description
DSN_OFFICE TYPE BAPI_MARA-DSN_OFFICE, "Laboratory/design office
NET_WEIGHT TYPE BAPI_MARA-NET_WEIGHT, " "Net weight
UNIT_OF_WT TYPE BAPI_MARA-UNIT_OF_WT, "Weight Unit
DIVISION TYPE BAPI_MARA-DIVISION, "Division
CAD_ID TYPE BAPI_MARA-CAD_ID, "Competitor
PROD_ALLOC TYPE BAPI_MARA-PROD_ALLOC, "Procurement rule
HAZMATPROF TYPE BAPI_MARA-HAZMATPROF, "Source of Supply
HIGH_VISC TYPE BAPI_MARA-HIGH_VISC, "Allowed packaging weight
LOOSEORLIQ TYPE BAPI_MARA-LOOSEORLIQ, "Long material number
PERIOD_IND_EXPIRATION_DATE TYPE BAPI_MARA-PERIOD_IND_EXPIRATION_DATE,"Expiration Dat
ITEM_CAT TYPE BAPI_MARA-ITEM_CAT, "General item category group
EXTMATLGRP TYPE BAPI_MARA-EXTMATLGRP, "External Material Group
*****CLIENT DATA INITIAL>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
MATL_GROUPX TYPE BAPI_MARAX-MATL_GROUP, "Materialgroup
OLD_MAT_NOX TYPE BAPI_MARAX-OLD_MAT_NO, "Old material number
BASE_UOMX TYPE BAPI_MARAX-BASE_UOM, "Base Unit of Measure
BASE_UOM_ISOX TYPE BAPI_MARAX-BASE_UOM_ISO, "Base unit of measure in ISO code
DOCUMENTX TYPE BAPI_MARAX-DOCUMENT, "Document number
DOC_TYPEX TYPE BAPI_MARAX-DOC_TYPE, "Document type
DOC_VERSX TYPE BAPI_MARAX-DOC_VERS, "Document version
DOC_FORMATX TYPE BAPI_MARAX-DOC_FORMAT,"Page format of document
DOC_CHG_NOX TYPE BAPI_MARAX-DOC_CHG_NO, "Document change number
PAGE_NOX TYPE BAPI_MARAX-PAGE_NO, "Production/Inspection Memo
PROD_MEMOX TYPE BAPI_MARAX-PROD_MEMO, "Page Format of Production Memo
SIZE_DIMX TYPE BAPI_MARAX-SIZE_DIM, "Size/dimensions
BASIC_MATLX TYPE BAPI_MARAX-BASIC_MATL, "Basic Material
STD_DESCRX TYPE BAPI_MARAX-STD_DESCR, "Industry Standard Description
DSN_OFFICEX TYPE BAPI_MARAX-DSN_OFFICE, "Laboratory/design office
NET_WEIGHTX TYPE BAPI_MARAX-NET_WEIGHT, " "Net weight
UNIT_OF_WTX TYPE BAPI_MARAX-UNIT_OF_WT, "Weight Unit
DIVISIONX TYPE BAPI_MARAX-DIVISION, "Division
PROD_HIERX TYPE BAPI_MARA, "Competitor
CAD_IDX TYPE BAPI_MARAX-PROD_HIER, "Procurement rule
ALLWD_VOLX TYPE BAPI_MARAX-ALLWD_VOL, "Allowed packaging
PVALIDFROMX TYPE BAPI_MARAX-PVALIDFROM, "Date from which the cross-plant material status
SVALIDFROMX TYPE BAPI_MARAX-SVALIDFROM, "Date from which the X-distr.-chain material stat
PROD_ALLOCX TYPE BAPI_MARAX-PROD_ALLOC,
HIGH_VISCX TYPE BAPI_MARAX-HIGH_VISC,"Indicator: Highly Viscous
LOOSEORLIQX TYPE BAPI_MARAX-LOOSEORLIQ, "Indicator: In Bulk/Liquid
INV_MAT_NO_EXTERNALX TYPE BAPI_MARAX-INV_MAT_NO_EXTERNAL,
EXTMATLGRPX TYPE BAPI_MARAX-EXTMATLGRP, " External Material Group
****<<<<<<<<<<<<<<PLANTDATA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
PLANT TYPE BAPI_MARC-PLANT, " Plant
MRP_TYPE TYPE BAPI_MARC-MRP_TYPE, "MRP Type
REORDER_PT TYPE BAPI_MARC-REORDER_PT, "Reorder Point
SAFETY_STK TYPE BAPI_MARC-SAFETY_STK, "Safety stock
MINLOTSIZE TYPE BAPI_MARC-MINLOTSIZE, "Minimum lot size
****<<<<<<<<<<<<<<PLANTDATA INITIAL>>>>>>>>>>>>>>>>>>>>>>
PLANTX TYPE BAPI_MARCX-PLANT, " Plant
MRP_TYPEX TYPE BAPI_MARCX-MRP_TYPE, "MRP Type
REORDER_PTX TYPE BAPI_MARCX-REORDER_PT, "Reorder Point
SAFETY_STKX TYPE BAPI_MARCX-SAFETY_STK, "Safety stock
MINLOTSIZEX TYPE BAPI_MARCX-MINLOTSIZE, "Minimum lot size
*<<<<<<<<<<<<<<<FORECASTPARAMETERS>>>>>>>>>>
F_PLANT TYPE BAPI_MPOPX-PLANT, " Plant
*<<<<<<<<<<<<<<<FORECASTPARAMETERS DATA INTIAL>>>>>>>>>>
F_PLANTX TYPE BAPI_MPOPX-PLANT, " Plant
*<<<<<<<<<<<<<<<PLANNING DATA >>>>>>>>>>>>>>>>>>>>>>>>>
P_PLANT TYPE BAPI_MPGD-PLANT, " Plant
*<<<<<<<<<<<<<<<PLANNING DATA INITAIAL >>>>>>>>>>>>>>>
P_PLANTX TYPE BAPI_MPGDX-PLANT, " Plant
*<<<<<<<<<<<<<<<STORAGELOCATIONDATA>>>>>>>>>>>>>>>>>>>>
S_PLANT TYPE BAPI_MARD-PLANT, " Plant
S_STGE_LOC TYPE BAPI_MARD-STGE_LOC,
*<<<<<<<<<<<<<<<STORAGELOCATIONDATA INITIAL>>>>>>>>>>
S_PLANTX TYPE BAPI_MARDX-PLANT, " Plant
S_STGE_LOCX TYPE BAPI_MARDX-STGE_LOC, "Storage Location
*<<<<<<<<<<<<<<<SALESDATA DATA >>>>>>>>>>
SALES_ORG TYPE BAPI_MVKE-SALES_ORG, "Sales Organization
DISTR_CHAN TYPE BAPI_MVKE-DISTR_CHAN, "Distribution Channel
*<<<<<<<<<<<<<<<SALESDATA DATA INITIAL >>>>>>>>>>
SALES_ORGX TYPE BAPI_MVKEX-SALES_ORG, "Sales Organization
DISTR_CHANX TYPE BAPI_MVKEX-DISTR_CHAN, "Distribution Channel
*****<<<<<<<<<<<<<<<MATERIAL_DESC>>>>>>>>>>>>>>>>>>>>>>>>>>
LANGU TYPE BAPI_MAKT-LANGU , "Language Key
LANGU_ISO TYPE BAPI_MAKT-LANGU_ISO , "Language according to ISO 639
MATL_DESC TYPE BAPI_MAKT-MATL_DESC , "Material Description
*****<<<<<<<<<<<<<<<GT_UNITSOFMEASURE>>>>>>>>>>>>>>>>>>>>>>>>>>
ALT_UNIT TYPE BAPI_MARM-ALT_UNIT,
"Alternative Unit of Measure for Stockkeeping Unit
ALT_UNIT_ISO TYPE BAPI_MARM-ALT_UNIT,
"Alternative Unit of Measure for Stockkeeping Unit
******<<<<<<<<<<<<<<<GT_UNITSOFMEASUREX>>>>>>>>>>>>>>>>>>>>>>>>>>
UNIT TYPE BAPI_MARMX-ALT_UNIT,
"Alternative Unit of Measure for Stockkeeping Unit
UNIT_ISO TYPE BAPI_MARMX-ALT_UNIT_ISO,
"Alternative unit of measure to stockkeeping unit in ISO code
*****<<<<<<<<<<<<<<<SALES TEXT>>>>>>>>>>>>>>>>>>>>>>>>>>
APPLOBJECT TYPE BAPI_MLTX-APPLOBJECT, "Texts: application object
TEXT_NAME TYPE BAPI_MLTX-TEXT_NAME, "Name
TEXT_ID TYPE BAPI_MLTX-TEXT_ID, "Text ID
S_LANGU TYPE BAPI_MLTX-LANGU, "Language key
TEXT_LINE TYPE BAPI_MLTX-TEXT_LINE, "Text line
END OF GT_FT_ITAB,
TEXT(243), " Return Message
WA_HEAD LIKE THEAD, " SalesText Header Info
ITAB_TLINE LIKE STANDARD TABLE OF TLINE WITH HEADER LINE, " SalesText
ERROR_REC TYPE I, " Error Records Counter
SUCCESS_REC TYPE I, " Successful Records Counter
TOT_REC TYPE I. " Total Records Counter
selection block for EXCEL UPLOAD FILE>>>>>>>>>>>>>>>>>>>>>>>>
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
PARAMETERS FILE TYPE IBIPPARMS-PATH OBLIGATORY .
SELECTION-SCREEN END OF BLOCK B1.
*<<<<AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .>>>>>>>>>>>>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = FILE.
**<<<<<<<<<<<<<<<<<START-OF-SELECTION.>>>>>>>>>>>>>>>>>>>>>>>>>>>
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD' "#EC *
EXPORTING
FILENAME = FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = GT_FT_ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11.
IF SY-SUBRC <> 0 .
MESSAGE E000.
ENDIF.
SKIP 3.
FORMAT COLOR COL_HEADING INVERSE ON.
WRITE 40 TEXT-001.
FORMAT COLOR COL_HEADING INVERSE OFF.
SKIP 1.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE :/3 TEXT-002, 13 SY-MANDT , 104 TEXT-003, 111 SY-UNAME,
/3 TEXT-004, 13 SY-DATUM , 104 TEXT-005, 111 SY-UZEIT.
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
SKIP 3.
LOOP AT GT_FT_ITAB.
HEADER-MATERIAL = GT_FT_ITAB-MATERIAL . " 'M-32'.
HEADER-IND_SECTOR = GT_FT_ITAB-IND_SECTOR . " 'C'.
HEADER-MATL_TYPE = GT_FT_ITAB-MATL_TYPE . " 'FERT'.
HEADER-BASIC_VIEW = GT_FT_ITAB-BASIC_VIEW . " 'X'.
HEADER-SALES_VIEW = GT_FT_ITAB-SALES_VIEW. " 'X'.
HEADER-PURCHASE_VIEW = GT_FT_ITAB-PURCHASE_VIEW . " 'X'.
HEADER-MRP_VIEW = GT_FT_ITAB-MRP_VIEW . " 'X'.
HEADER-FORECAST_VIEW = GT_FT_ITAB-FORECAST_VIEW . " 'X'.
HEADER-WORK_SCHED_VIEW = GT_FT_ITAB-WORK_SCHED_VIEW ." 'X'.
HEADER-PRT_VIEW = GT_FT_ITAB-PRT_VIEW . " 'X'.
HEADER-STORAGE_VIEW = GT_FT_ITAB-STORAGE_VIEW . " 'X'.
HEADER-WAREHOUSE_VIEW = GT_FT_ITAB-WAREHOUSE_VIEW . " 'X'.
HEADER-QUALITY_VIEW = GT_FT_ITAB-QUALITY_VIEW . " 'X'.
HEADER-ACCOUNT_VIEW = GT_FT_ITAB-ACCOUNT_VIEW . " 'X'.
HEADER-COST_VIEW = GT_FT_ITAB-COST_VIEW . " 'X'.
*<<CLIENT DATA>>>>>>>>>>>>>>>>>>>>>>>>>>>>
GT_CLIENTDATA-MATL_GROUP = GT_FT_ITAB-MATL_GROUP . " '01'.
GT_CLIENTDATA-OLD_MAT_NO = GT_FT_ITAB-OLD_MAT_NO . " '1000'.
GT_CLIENTDATA-BASE_UOM = GT_FT_ITAB-BASE_UOM . " 'EA'.
GT_CLIENTDATA-BASE_UOM_ISO = GT_FT_ITAB-BASE_UOM_ISO ." 'EA'.
GT_CLIENTDATA-DOCUMENT = GT_FT_ITAB-DOCUMENT . "'MATERIAL'.
GT_CLIENTDATA-DOC_TYPE = GT_FT_ITAB-DOC_TYPE . " 'A'.
GT_CLIENTDATA-DOC_VERS = GT_FT_ITAB-DOC_VERS . " '5'.
GT_CLIENTDATA-DOC_FORMAT = GT_FT_ITAB-DOC_FORMAT . " '5'.
GT_CLIENTDATA-DOC_CHG_NO = GT_FT_ITAB-DOC_CHG_NO . " 'A4'.
GT_CLIENTDATA-PAGE_NO = GT_FT_ITAB-PAGE_NO . " '1'.
GT_CLIENTDATA-PROD_MEMO = GT_FT_ITAB-PROD_MEMO . " 'MEMO'.
GT_CLIENTDATA-PAGEFORMAT = GT_FT_ITAB-PAGEFORMAT . " '1'.
GT_CLIENTDATA-SIZE_DIM = GT_FT_ITAB-SIZE_DIM . " '50/50'.
GT_CLIENTDATA-BASIC_MATL = GT_FT_ITAB-BASIC_MATL . " 'BASIS MATERIAL1'.
GT_CLIENTDATA-STD_DESCR = GT_FT_ITAB-STD_DESCR . " 'MATERIAL DESC'.
GT_CLIENTDATA-DSN_OFFICE = GT_FT_ITAB-DSN_OFFICE . " '001'.
GT_CLIENTDATA-NET_WEIGHT = GT_FT_ITAB-NET_WEIGHT . " 1000.
GT_CLIENTDATA-UNIT_OF_WT = GT_FT_ITAB-UNIT_OF_WT . " 'KG'.
GT_CLIENTDATA-TRANS_GRP = '0001'.
GT_CLIENTDATA-DIVISION = GT_FT_ITAB-DIVISION . " '01'.
GT_CLIENTDATA-QTY_GR_GI = '9000'.
GT_CLIENTDATA-CAD_ID = GT_FT_ITAB-CAD_ID . " 'X'.
GT_CLIENTDATA-ALLWD_VOL = '9000'.
GT_CLIENTDATA-PROD_ALLOC = GT_FT_ITAB-PROD_ALLOC . " 'PA01'.
GT_CLIENTDATA-HAZMATPROF = GT_FT_ITAB-HAZMATPROF . " '001'.
GT_CLIENTDATA-HIGH_VISC = GT_FT_ITAB-HIGH_VISC . " 'X'.
GT_CLIENTDATA-LOOSEORLIQ = GT_FT_ITAB-LOOSEORLIQ . " 'X'.
GT_CLIENTDATA-PERIOD_IND_EXPIRATION_DATE = GT_FT_ITAB-PERIOD_IND_EXPIRATION_DATE . " 'D'.
GT_CLIENTDATA-ITEM_CAT = 'NORM' . "GT_FT_ITAB-ITEM_CAT . " 'NORM'.
GT_CLIENTDATA-EXTMATLGRP = GT_FT_ITAB-EXTMATLGRP . " '01'.
**<<<<<<<<CLIENT DATA INITIAL>>>>>>>>>>>>>
GT_CLIENTDATAX-MATL_GROUP = 'X'.
GT_CLIENTDATAX-OLD_MAT_NO = GT_FT_ITAB-OLD_MAT_NO . " 'X'.
GT_CLIENTDATAX-BASE_UOM = GT_FT_ITAB-BASE_UOM . " 'X'.
GT_CLIENTDATAX-BASE_UOM_ISO = GT_FT_ITAB-BASE_UOM_ISO . "'X'.
GT_CLIENTDATAX-DOCUMENT = GT_FT_ITAB-DOCUMENT . "'X'.
GT_CLIENTDATAX-DOC_TYPE = GT_FT_ITAB-DOC_TYPE . "'X'.
GT_CLIENTDATAX-DOC_VERS = GT_FT_ITAB-DOC_VERS . "'X'.
GT_CLIENTDATAX-DOC_FORMAT = GT_FT_ITAB-DOC_FORMAT . "'X'.
GT_CLIENTDATAX-DOC_CHG_NO = GT_FT_ITAB-DOC_CHG_NO . "'X'.
GT_CLIENTDATAX-PAGE_NO = GT_FT_ITAB-PAGE_NO . "'X'.
GT_CLIENTDATAX-PROD_MEMO = GT_FT_ITAB-PROD_MEMO . "'X'.
GT_CLIENTDATAX-PAGEFORMAT = 'X'.
GT_CLIENTDATAX-SIZE_DIM = GT_FT_ITAB-SIZE_DIM . "'X'
GT_CLIENTDATAX-BASIC_MATL = GT_FT_ITAB-BASIC_MATL. "'X'.
GT_CLIENTDATAX-STD_DESCR = GT_FT_ITAB-STD_DESCR . "'X'.
GT_CLIENTDATAX-DSN_OFFICE = GT_FT_ITAB-DSN_OFFICE . "'X'.
GT_CLIENTDATAX-NET_WEIGHT = GT_FT_ITAB-NET_WEIGHT . "'X'.
GT_CLIENTDATAX-UNIT_OF_WT = GT_FT_ITAB-UNIT_OF_WT . "'X'.
GT_CLIENTDATAX-DIVISION = GT_FT_ITAB-DIVISION . "'X'.
GT_CLIENTDATAX-PROD_HIER = GT_FT_ITAB-PROD_HIERX . "'X'.
GT_CLIENTDATAX-CAD_ID = GT_FT_ITAB-CAD_ID . "'X'.
GT_CLIENTDATAX-ALLWD_VOL = GT_FT_ITAB-ALLWD_VOLX . "'X'.
GT_CLIENTDATAX-PROD_ALLOC = GT_FT_ITAB-PROD_ALLOCX . "'X'.
GT_CLIENTDATAX-HAZMATPROF = 'X'.
GT_CLIENTDATAX-HIGH_VISC = GT_FT_ITAB-HIGH_VISCX . "'X'.
GT_CLIENTDATAX-LOOSEORLIQ = GT_FT_ITAB-LOOSEORLIQX . "'X'.
GT_CLIENTDATAX-ITEM_CAT = 'X'.
GT_CLIENTDATAX-INV_MAT_NO_EXTERNAL = GT_FT_ITAB-INV_MAT_NO_EXTERNALX . "'X'.
GT_CLIENTDATAX-EXTMATLGRP = GT_FT_ITAB-EXTMATLGRPX . " 'X'.
GT_CLIENTDATAX-TRANS_GRP = 'X'.
GT_CLIENTDATAX-QTY_GR_GI = 'X'.
GT_CLIENTDATAX-ALLWD_VOL = 'X'.
***<<<<<PLANTDATA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
GT_PLANTDATA-PLANT = GT_FT_ITAB-PLANT . " '0001'.
GT_PLANTDATA-MRP_TYPE = GT_FT_ITAB-MRP_TYPE . "'ND'.
GT_PLANTDATA-PUR_GROUP = '001'. "Purchasing Group
GT_PLANTDATA-PROC_TYPE = 'F'. "Procurement Type
GT_PLANTDATA-SPPROCTYPE = '10'. "Special procurement type
GT_PLANTDATA-REORDER_PT = GT_FT_ITAB-REORDER_PT . "8000.
GT_PLANTDATA-SAFETY_STK = 2.
GT_PLANTDATA-LOADINGGRP = '0001'. "Loading group
GT_PLANTDATA-MINLOTSIZE = GT_FT_ITAB-MINLOTSIZE . "6000.
**<<<<<<<<PLANT DATA INITIAL>>>>>>>>>>>>>
GT_PLANTDATAX-PLANT = GT_FT_ITAB-PLANTX. " '0001'.
GT_PLANTDATAX-MRP_TYPE = GT_FT_ITAB-MRP_TYPEX. " 'X'.
GT_PLANTDATAX-PUR_GROUP = 'X'. "Purchasing Group
GT_PLANTDATAX-PROC_TYPE = 'X'. "Procurement Type
GT_PLANTDATAX-SPPROCTYPE = 'X'. "Special procurement type
GT_PLANTDATAX-LOADINGGRP = 'X'. "Loading group
GT_PLANTDATAX-REORDER_PT = GT_FT_ITAB-REORDER_PTX. " 'X'.
GT_PLANTDATAX-SAFETY_STK = GT_FT_ITAB-SAFETY_STKX. "'X'.
GT_PLANTDATAX-MINLOTSIZE = GT_FT_ITAB-MINLOTSIZEX. "'X'.
*<<<<<<<<<<<<<<<FORECASTPARAMETERS>>>>>>>>>>
GT_FORECASTPARAMETERS-PLANT = GT_FT_ITAB-F_PLANT. " '0001'.
*<<<<<<<<<<<<<<<FORECASTPARAMETERS DATA INTIAL>>>>>>>>>>
GT_FORECASTPARAMETERSX = '0001'.
GT_FORECASTPARAMETERSX-PLANT = GT_FT_ITAB-F_PLANTX. " '0001'.
*<<<<<<<<<<<<<<<PLANNING DATA >>>>>>>>>>
*GT_PLANNINGDATA-PLANT = GT_FT_ITAB-P_PLANT. " '0001'.
GT_PLANNINGDATA-PLANT = '0001'.
*<<<<<<<<<<<<<<<PLAN -
Hi Experts,
I m looking for some abap sample programs to build a program with tabs.
In any tab you have a table (ALV GRID ) with buttons to move up/down the selected row.1.Table maintanence generateor is used to maintain the table .
If u want to allow others to create new entries u have to maintain the table.Which will have all the changes to the table.so that the users can get the newly activated table to go for further process..
2.
To edit the grid value u have to set the fieldcate.
WA_FIELDCAT-EDIT = ''X'.
3.
Table control s used for the changes then and there and user friendly
ALV is for Sort layoput changes and can download to wordformat etc... -
hi,
why BAPI is required instead of BDC and what secenario we will use BAPI and BDC?
Thanks in advance.Hi Baskar,
Difference between BDC and BAPI
BDC is traditional way of coding the transactions for uploading the legacy data, Sap is changing all transactions to Object oriented programming. Since BAPI is Object based and supports all the new transactions it is preffered over BDC. More over BAPI's process data faster than BDC.
BAPI is a SAP-supplied function module with a defined interface, which allows you to interact with various business objects. SAP guarantees the integrity of your database for anything updated using a BAPI. BDC is a method of driving screens programatically, for updating SAP data. BAPIs are generally faster than BDCs.
A BAPI is faster because it is updating the DB "directly". Whereas BDC with call
transaction goes through the whole screen sequence like any user would do, simply put, fills screens.
However - there is not always a BAPI for a particular transaction and not all functions that are performed by a transaction can be done by a BAPI. BDCs produce error sessions which can be processed by the user, while BAPIs don't.
First choose the BAPI ,if there is no BAPI go for BDC.
why BAPI first not BDC.
SAP comes up with Change in Version, so each and every time they will change the screens/number etc.
so you have to change your BDC programs accordingly.
and also Most of the Latest versions transactions are Enjoy Transaction. they will not support BDC's in Background.
But Using BAPI's No such disadvantages.
A BAPI is faster because it is updating the DB "directly" through ABAP code.
A BDC with call transaction goes through the whole screen sequence like any user would do, simply put, it is filling screens.
Actually it depends on your requirement but BAPI is more effective as it is standard function module to update SAP databases rather than BDC.
using bdc over bapi has advantages and also disadvantages
advantages:
1. using bdc we can upload data into database tables using 2 ways
1. foreground -
means that user interaction is there for each and every record.
2. back ground -
no user interaction and tasks are done automatically.
using these two options is one of the greatest advantage over bapi.
2. in bdc call transaction method we can control the display of screen resolution which is not possible with bapi's
3. bdc is generally used for transferring of large amount of data than bapi's
4.session method of bdc allows us to place data directly in application server and then finally transfered into sap database tables
disadvantages:
1.bdc is only used for sap to sap system data transferring
2. bapis's generally works more faster than bdc's
3. using bapis we can connect to remote systems and also to non sap systems.
if useful reward some points.
A BAPI is a method of a SAP Business Object. BAPI enables SAP and third party applications to interact and integrate
with each other at the Business Object / Process level.
Check this link to know more about BAPI.
http://www.sapgenie.com/abap/bapi/example.htm
http://sappoint.com/abap/
Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided since the early versions of R/3. BDC is not a
typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and so it is not bi-directional.
BDC works on the principle of simulating user input for transactional screen, via an ABAP program. Typically the input comes in the form
of a flat file. The ABAP program reads this file and formats the input data screen by screen into an internal table (BDCDATA). The
transaction is then started using this internal table as the input and executed in the background.
In Call Transaction, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling.
It can also be used for real-time interfaces and custom error handling & logging features. .
To know more about BDC,
check the link.
http://sappoint.com/abap/
Main differences are...
In case of bdc data transfer takes place from flat file into sap system ie the file existing in sap system to sap sytem
where is bapi's r remotly enabled function modules which are assigned to some business objects n used to transfer the data between different business partners who are using different systems other than sap.
not only that...
when you plan to upgrade your system version then bdc willnot support those upgradations where as bapi's will support.
<b>Reward points if this helps.
Manish</b> -
Evaluate multiple selected rows within ABAP WD ALV
Hi,
I am using ALV within WebDynpros for ABAP. It's easily possible for users to select multiple rows. Subsequently I'd like to process only the selected rows further. How would I find out, which rows were selected?
There should be a standard way via wd_this or wd_context, I don't seem to have found it yet.
All ideas are appreciated.
Regards, ReneHi Rene,
If you use external context binding to pass the table, the information of the selected rows should be available in the context node you passed (Get_Selected_elements).
Ciao, Regina -
Turning Tables in ABAP for ALV Display
Dear all,
I am running in a (for me) tricky problem:
I read any table definitions from the dictionary with function "DDIF_TABL_GET". In the next step I want to build a ALV Grid that displays some of the read data but not in rows but in lines.
Ok how does this look like:
For example use funktion DDIF_TABL_GET and use table MAKT as table parameter:
Result:
TABNAME FIELDNAME DD POSI K M ROLLNAME CHECKTABLE A I INTLEN REFTABLE
MAKT MANDT DE 0001 X MANDT T000 0 C 000003
MAKT MATNR DE 0002 X MATNR MARA 0 C 000018
MAKT SPRAS DE 0003 X SPRAS T002 0 C 000001
MAKT MAKTX DE 0004 MAKTX 0 C 000040
MAKT MAKTG DE 0005 MAKTG 0 C 000040
Ok what I want to do now is dynamically create a alv-Grid that shows the entries from the result above as list:
Example:
MAKT MAKT MAKT MAKT MAKT
MANDT MATNR SPRAS MAKTX MAKTG
DE DE DE DE DE
0001 0002 0003 0004 0005
X X X
MANDT MATNR SPRAS MAKTX MAKTG
There is a funktion in Excel called "Transponieren" (transpond) that does the same I search.
So the secret question is how to do this with ALV and dynamically???
Any idea?
Kind reagard for any hints and helps
Roman BeckerHi Roman,
my answer is kind of abstract: I implemented just the internal tables transposal.
I defined a structure of 99 string components, si you can put in whatever you want.
For illustration I fill the table with identifiers for row and column and the do the exel-like transposal.
The original table is lt_itab, the transposed one lt_trsp.
I used the string component's structure a couple of times now. This is smart because it won't waste more memory than needed.
Just cut&paste to get an idea, hope you like it!
FORM tab_transpose.
TYPES:
BEGIN OF ty_compstr,
f01 TYPE string,
f02 TYPE string,
f03 TYPE string,
f04 TYPE string,
f05 TYPE string,
f06 TYPE string,
f07 TYPE string,
f08 TYPE string,
f09 TYPE string,
f10 TYPE string,
f11 TYPE string,
f12 TYPE string,
f13 TYPE string,
f14 TYPE string,
f15 TYPE string,
f16 TYPE string,
f17 TYPE string,
f18 TYPE string,
f19 TYPE string,
f20 TYPE string,
f21 TYPE string,
f22 TYPE string,
f23 TYPE string,
f24 TYPE string,
f25 TYPE string,
f26 TYPE string,
f27 TYPE string,
f28 TYPE string,
f29 TYPE string,
f30 TYPE string,
f31 TYPE string,
f32 TYPE string,
f33 TYPE string,
f34 TYPE string,
f35 TYPE string,
f36 TYPE string,
f37 TYPE string,
f38 TYPE string,
f39 TYPE string,
f40 TYPE string,
f41 TYPE string,
f42 TYPE string,
f43 TYPE string,
f44 TYPE string,
f45 TYPE string,
f46 TYPE string,
f47 TYPE string,
f48 TYPE string,
f49 TYPE string,
f50 TYPE string,
f51 TYPE string,
f52 TYPE string,
f53 TYPE string,
f54 TYPE string,
f55 TYPE string,
f56 TYPE string,
f57 TYPE string,
f58 TYPE string,
f59 TYPE string,
f60 TYPE string,
f61 TYPE string,
f62 TYPE string,
f63 TYPE string,
f64 TYPE string,
f65 TYPE string,
f66 TYPE string,
f67 TYPE string,
f68 TYPE string,
f69 TYPE string,
f70 TYPE string,
f71 TYPE string,
f72 TYPE string,
f73 TYPE string,
f74 TYPE string,
f75 TYPE string,
f76 TYPE string,
f77 TYPE string,
f78 TYPE string,
f79 TYPE string,
f80 TYPE string,
f81 TYPE string,
f82 TYPE string,
f83 TYPE string,
f84 TYPE string,
f85 TYPE string,
f86 TYPE string,
f87 TYPE string,
f88 TYPE string,
f89 TYPE string,
f90 TYPE string,
f91 TYPE string,
f92 TYPE string,
f93 TYPE string,
f94 TYPE string,
f95 TYPE string,
f96 TYPE string,
f97 TYPE string,
f98 TYPE string,
f99 TYPE string,
END OF ty_compstr.
DATA:
lt_itab TYPE TABLE OF ty_compstr,
lt_trsp TYPE TABLE OF ty_compstr,
ls_irec TYPE ty_compstr,
lv_num2 TYPE num2,
lv_num2_i TYPE num2.
FIELD-SYMBOLS:
<anyfield> TYPE ANY,
<anyrec> TYPE ANY,
<anyfield_t> TYPE ANY,
<anyrec_t> TYPE ANY.
random fill
DO 99 TIMES.
lv_num2 = sy-index.
DO 99 TIMES.
ASSIGN COMPONENT sy-index OF STRUCTURE ls_irec TO <anyfield>.
lv_num2_i = sy-index.
CONCATENATE 'ROW' lv_num2 'COL' lv_num2_i ':' <anyfield>
INTO <anyfield> SEPARATED BY space.
ENDDO.
APPEND ls_irec TO lt_itab.
ENDDO.
Transposal
LOOP AT lt_itab ASSIGNING <anyrec>.
lv_num2 = sy-tabix.
DO.
lv_num2_i = sy-index.
ASSIGN COMPONENT sy-index OF STRUCTURE <anyrec> TO <anyfield>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
READ TABLE lt_trsp INDEX lv_num2_i ASSIGNING <anyrec_t>.
IF sy-subrc <> 0.
APPEND INITIAL LINE TO lt_trsp.
READ TABLE lt_trsp INDEX sy-tfill ASSIGNING <anyrec_t>.
ENDIF.
ASSIGN COMPONENT lv_num2 OF STRUCTURE <anyrec_t> TO <anyfield_t>.
<anyfield_t> = <anyfield>.
ENDDO.
ENDLOOP." at lt_itab assigning <anyrec>.
ENDFORM. " tab_transpose
C. -
hi all,
My BDC program is going to dump while execution. Below I'm pasting the report.
TYPES : BEGIN OF IT_INPUT,
PERNR TYPE PERNR_D,
CHOIC TYPE CHOIC,
BEGDA TYPE CHAR10,
ENDDA TYPE CHAR10,
ANREX TYPE ANREX,
NACHN TYPE NACHN,
VORNA TYPE VORNA,
GBPAS TYPE GBPAS,
SPRSL TYPE SPRSL,
END OF IT_INPUT.
TYPES : BEGIN OF IT_RAW,
LINE TYPE CHAR120,
END OF IT_RAW.
INTERNAL TABLES
DATA : IT_FINAL TYPE STANDARD TABLE OF IT_INPUT.
DATA : IT_RAW TYPE STANDARD TABLE OF IT_RAW.
DATA : IT_ERROR TYPE STANDARD TABLE OF BDCMSGCOLL.
WORK AREA
DATA : WA_FINAL TYPE IT_INPUT.
DATA : WA_RAW TYPE IT_RAW.
DATA : WA_ERROR TYPE BDCMSGCOLL.
CONSTANTS : C_TAB TYPE C value '/'.
INCLUDE : BDCRECXY.
START-OF-SELECTION.
SUBROUTINE TO READ DATA FROM FLAT FILE
PERFORM READ_DATA_FROM_FF.
SUBROUTINE TO MAP DATA TO SCREEN FIELDS
PERFORM DATA_MAPPING.
*& Form READ_DATA_FROM_FF
text
--> p1 text
<-- p2 text
FORM READ_DATA_FROM_FF .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'E:\RAG\BDC1.txt'
TABLES
DATA_TAB = IT_RAW
IF sy-subrc eq 0.
LOOP AT IT_RAW INTO WA_RAW.
SPLIT WA_RAW
AT C_TAB
INTO WA_FINAL-PERNR
WA_FINAL-CHOIC
WA_FINAL-BEGDA
WA_FINAL-ENDDA
WA_FINAL-ANREX
WA_FINAL-NACHN
WA_FINAL-VORNA
WA_FINAL-GBPAS
WA_FINAL-SPRSL.
APPEND WA_FINAL TO IT_FINAL.
WRITE : WA_FINAL.
CLEAR WA_FINAL.
ENDLOOP.
ENDIF.
ENDFORM. " READ_DATA_FROM_FF
*& Form DATA_MAPPING
text
--> p1 text
<-- p2 text
FORM DATA_MAPPING .
LOOP AT IT_FINAL INTO WA_FINAL.
FIRST SCREEN INFORMATION FOR PA30
perform bdc_dynpro using 'SAPMP50A' '1000'.
perform bdc_field using 'RP50G-PERNR'
WA_FINAL-PERNR.
*perform bdc_field using 'BDC_CURSOR'
'T582S-ITEXT(03)'.
perform bdc_field using 'RP50G-SELEC(03)'
'X'.
perform bdc_field using 'RP50G-TIMR6'
'X'.
perform bdc_field using 'RP50G-CHOIC'
'0002'.
perform bdc_field using 'BDC_OKCODE'
'=INS'.
SECOND SCREEN INFORMATION 0002
perform bdc_dynpro using 'MP000200' '2001'.
*perform bdc_field using 'BDC_CURSOR'
'Q0002-GBPAS'.
perform bdc_field using 'BDC_OKCODE'
'UPD'.
perform bdc_field using 'P0002-BEGDA'
WA_FINAL-BEGDA.
perform bdc_field using 'P0002-ENDDA'
WA_FINAL-ENDDA.
perform bdc_field using 'Q0002-ANREX'
WA_FINAL-ANREX.
perform bdc_field using 'P0002-NACHN'
WA_FINAL-NACHN.
perform bdc_field using 'P0002-VORNA'
WA_FINAL-VORNA.
perform bdc_field using 'Q0002-GBPAS'
WA_FINAL-GBPAS.
perform bdc_field using 'P0002-SPRSL'
WA_FINAL-SPRSL.
perform bdc_transaction tables it_error using 'PA30' 'x' 'a' 'a'.
IF it_ERROR[] IS NOT INITIAL.
LOOP AT it_ERROR INTO wa_ERROR.
WRITE : wa_ERROR.
ENDLOOP.
REFRESH it_ERROR.
ENDIF.
ENDLOOP.
Error which I was getting is 'UNABLE TO INTERPRET '/ ' AS A NUMBER'.Hi
Look out for the error in the flat file which you are uploading. I have seen this error and I found it in Flat file. its a conversion error.
Just copy few lines from the original file, make a new file and upload it. In this way, you will be able to say whether there is an error in file or in code.
Regards
Waz
Maybe you are looking for
-
Install Netweaver 7.1, service pack 3 on Windows 2008 Server 64bit
Hi All, Good Morning. I am working as Oracle APPS DBA. I had a requirement for installing Netweaver 7.1, service pack 3 on Windows 2008 Server 64bit machine. I need this Application server for Vertex O-Series which is working with SQL Server as the
-
Hi, While doing MIRO, the invoice and the details fetched from the PO (purchase order) match perfectly. Despite the details getting matched the invoice gets blocked for payment with the reason as R. Is this a standard SAP functionality or its customi
-
Extract data from SAP and send to external system via Webmethods & IDOC's
Hi, We need to Extract data from SAP and send to an external system via Webmethods middlewear using IDOCs. I have never used webmethods before and would like to know more about how to implement this scenario. I have used IDOCS in an EDI scenario befo
-
I have 2 ATVs. An ATV2 and ATV3. I have the latest iTunes sw on my MBPro and on the ATV3. I can see the ATV2 in iTunes and it works perfectly. I can't see the ATV3 in iTunes. I can see iTunes from the ATV3. Both ATVs and the MBPro are on the sa
-
HI I am trying to capture some 24 frames per second footage I filmed on a Panasonic DVX100 and one of the Final Cut Pro capture settings is for the 2:3:3:2 advnaced pulldown removal for 24fps. However, in the summary, it has the frames per second lis