Coding required
Hi i am not a pure abaper ..so please help with sample coding
my scenario is
i have a table.it contains 3 fields. MATNO,SUBTYPE,qty.for each SUBTYPE one MATNO is assigned.
i want read the table based on the subtype and display a pop up for which subtype the material no is not assigned.
for example
(MATNO) (SUBTYPE) (QTY)
X2 A1 10
X3 A2 12
X4 A4 12
--- A5 11
--- A6 10
so we need display a popup saying for A5,A6 subtype the materail no is not assigned.
kindly help me sample coding,as it is urgent
thanks in advance.
praveen
Hi Praveen,
data: l_var1 type char20.
l_var1 = 'For these sub types'.
Itab contains the data with subtypes and materials
LOOP at itab into w_itab.
If w_itab-matnr is initial.
CONCATENATE l_var1 w_itab-subtype INTO l_var1.
endif.
endloop.
CONCATENATE l_var1 'Material no is not assigned'
INTO l_var1.
message i999 with l_var1.
Regards.
Kiran.
Similar Messages
-
i have never done any proxies so is there any coding required in ABAP part, i am using ABAP proxies
thanking you
sridharHi
Here is the sample code
Report <report name>.
data prxy type ref to <Interfacename>.
create object prxy.
data it type <Message type>.
try.
it-mt_file_input_proxy-detail-name = 'Sravya'.
it-mt_file_input_proxy-detail-lname = 'text'.
it-mt_file_input_proxy-detail-address = 'NetWeaver'.
call method prxy->execute_asynchronous
exporting
output = it.
commit work
**TRY.
call method <Interfacename>=>execute_asynchronous
exporting
CONTROLLER =
output = it
CATCH CX_AI_SYSTEM_FAULT .
*ENDTRY.
catch cx_ai_system_fault .
data fault type ref to cx_ai_system_fault .
create object fault.
write :/ fault->errortext.
write:/'error occured'.
endtry.
Try this it may help u...
Regards
Yuga -
ABAP coding required in order to send Output via External Send (5)
Hi
I require some coding to an ABAP program in order for my SD output to be succesfully sent by 'external send'
I have a shipping output type.
assigned Partner functions and applicable mediums - 1, 2 and 5
however when trying to produce output via comm method 5, external send, i am gettting red error messages/ traffic ligh
processing log is as follows:-
"processing log for program xxxxxxxx routine ENTRY
Please enter an address number
communication type cannot be used"
all outputs for medium types 2 Fax and 1 print are all OK for all Partner functions involved
I have changed to another output which works fine,:- altho as this was written specifically for another outut,and form, so there is a lot of data missing on the form with this program.
we have tried to deciper the coding on the program that does work, but to no avail
Many thanks for your help on this matter
TonyYou need to maintain/fill ADDR_KEY structure in the print program....
-
Based on fault message ABAP coding required.
Dear Experts,
I design a scenario with Proxy to JDBC Synchronous interface, in that i kept fault message to catch the technical errors which are throwing by Oracle system like " unique constaint violated, can't insert value into a particular field ". This type of error messages we can able to get in sxmb_moni of PI system as below shown, but we need the same message in SAP system. For that what we have to do in ABAP as well as PI sides. Below highlighted error message wants in SAP Screen.
Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SAP:Category>XIAdapterFramework</SAP:Category>
<SAP:Code area="MESSAGE">GENERAL</SAP:Code>
<SAP:P1 />
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PDI_PIPE' (structure 'Statement'): com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK_PDI_PIPE'. Cannot insert duplicate key in object 'dbo.PDI_PIPE'.</SAP:AdditionalText>
<SAP:Stack />
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
Kindly suggest me..
Thanks & Regards,
Srihari.Hi,
We can easily implement fault message coding in ABAP server proxies, but in case of JDBC not sure you can implement this.
one sulution is write a stored procedure in receiver side and you can have a flexibility to send error message as a response(in vaid exml format).
using standard insert statement/anyother data base operation without stored procedure not posible to capture these kind of errors in to falut messages and sending back to ECC may be not possible.
regards,
Raj -
How much % of coding required ideally for an XI project?
Hi,
1) I would like to know,how much % of codinng part will be there for an XI project?
2)duration for XI implementation.
ofocurse it depends on project to project, but ideally i would like to know..
Thanks for your reply,
cgHI,
Look for the thread Effort estimation to integrate SAP & Non-SAP systems for the overall implementation duration.
For the code development effort,
mostly connected to
1. Mapping (XSLT java, XSLT ABAP)
2. RFC development
3. Third Party applications involving SCRIPTS (incase of FILE etc.,)
Add at least 2 to 4 weeks to the overall time.
One point to say at this time is that XI development doesn't only mean Java coding but ABAP too. Above thread I tried posting the overall time frame
to know and process with ABAP as well.
If you are looking for any specific RFC or BAPIC calls, please let us know and probably will be able to give you if I have it in my repositoty.
Thanks,
Srini. -
Coding Required for Data Load...
Hi All,
I am stuck up in an issue where I know the logic but unable to write a code. I have the requirement as follows :-
I have the records in Excel as given below:-
Fiscal Year 2004
Key 004
Capitalization A
Norm Debts B=0.7*A
Rate of Interest C
Repayment D=B/10
Op. Balance D=B/10
Cl. Balance E = B-D
Total Interest G=E+F/2*C
The above records are the data which I am loading first time and only one record. The cube shud be populated with the data till Closing Balance becomes zero.
So my logic will be
First record by excel and second onwards is :-
Fiscal Year 2004 +1 (It shud add 1 to every record till closing balance becomes zero)
Key 004 (Constant till Closing balance becomes Zero)
Capitalization A (Constant till Closing balance becomes Zero)
Norm Debts B (Constant till Closing balance becomes Zero)
Rate of Interest C (Constant till Closing balance becomes Zero)
Repayment D (Constant till Closing balance becomes Zero)
Opening Balance (Closing Balance will become Opening Balance here) = B-D
Closing Balance (Closing balance will now again will be debited by repayment that is B-2D)
Total interest = (Opening Balance + Closing Balance)/ 2 * Rate of Interest
So next record will be opening balance = B-2D and Closing Balance will be B-3D and the record shud be automatically fetched till Closing Balance becomes zero.
Any help will be assigned with points.
Thanks and Regards,
Sangini Mathur.Hi Sangini,
I think in ur case u have to LOOP aginst source_package
in the start routine only then you can get ur requirement.
Data: w_temp1 like source_package-cl.balance.
while w_temp1 eq 0.
Put all your calculations here
endwhile.
Hope it helps
Bhaskar
Edited by: shanthi bhaskar on Jun 3, 2008 2:34 PM -
Urgent labView coding required
sir, can you please bulid a VI for me that-
1]From Relay Off to On Position-
can initiate a timer (When 'x' is ON), as well as turn ON a Numeric Indicator that displays the corresponding input voltage and when ('y' is ON), stops both the timer as well as the indicator and they both hold their values and must have a reset button to reset the values...
2]From Relay On to Off Position-
Also, now when ('x' and 'y' both are ON), when 'x' goes OFF, the timer should initiate and the indicator should display the corresponding input voltage and when 'y' goes OFF, both the timer and the indicator should stop, and they both hold their values and must reset their values..
Sir, will it be possible to use two use timers and two indicators for this purpose.. sir, please help me out, me in a complete mess...Please keep all related questons in one place:
http://forums.ni.com/ni/board/message?board.id=170&thread.id=325397&jump=true
Thanks!
LabVIEW Champion . Do more with less code and in less time . -
ABAP to XML file - Formatting problem and UTF-8 requirement
Hi Everyone,
Could you please guide us on the ABAP coding required to get the proper XML file format. We have prepared the code for downloading SAP transaction data into an XML file format. However, we are stuck with an improper format as per Example 1.
The file format we get is this:
Example 1:
<?xml version="1.0"?><FDXLMDOrd><FXNHdrLp><CrtDtTm>20070613094517</CrtDtTm><MsgID>319304155</MsgID><MsgTyp>850</MsgTyp><MsgSubTyp>SALES_A</MsgSubTyp><Pr
<RcvTP>FSCS</RcvTP><SndSrc>FXN</SndSrc><RcvSrc>EIB</RcvSrc><UsrID>VAR</UsrID></FXNHdrLp><OrdHdrLp><OrdNbr>319304155</OrdNbr><OrdActnCD>9</OrdActnCD><Ord
teCarrReq>FDE</RteCarrReq><RteTptSvcReq>FEIP</RteTptSvcReq></DprtRteLp><SpecInstrLp><SpecInstrTyp>SHIP</SpecInstrTyp><SpecInstr>Example Packing Instruct
les Order</RefDesc></RefLp><RefLp><RefIDQual>CPO</RefIDQual><RefID>test 1 line 1 pc - s</RefID><RefDesc>Customers Customer Purchase Order</RefDesc></Ref
Typ><EntIDQual>91</EntIDQual><EntID>H00092</EntID><EntNm>VLAD BOBES</EntNm><Cty>MONTREAL</Cty><PstlCD>H3X 2N5</PstlCD><RgnalCD>QC</RgnalCD><CtryISOCD>CA
></AdrLnLp><ConLp><ConTypCD>IC</ConTypCD><ConNm>VLAD BOBES</ConNm><CommLp><CommNbrQual>TE</CommNbrQual><CommNbr>514-731-8361</CommNbr></CommLp></ConLp><
<Cty>MONTREAL</Cty><PstlCD>H3X 2N5</PstlCD><RgnalCD>QC</RgnalCD><CtryISOCD>CA</CtryISOCD><AddlNmLp><AddlNm1>VLAD BOBES</AddlNm1></AddlNmLp><AdrLnLp><Str
However, the format need to look like this as in Example 2 below.
We also need help in how to get " encoding="UTF-8"?> " as part of the file format.
Example 2:
<?xml version="1.0" encoding="UTF-8"?>
<FDXLMDProdRcpt>
<FXNHdrLp>
<CrtDtTm>20070612151817</CrtDtTm>
<SessID>26796</SessID>
<MsgTyp>861</MsgTyp>
<MsgSubTyp>WRE_A</MsgSubTyp>
<PrcsingPrty>5</PrcsingPrty>
<SndTPQualCD>ZZ</SndTPQualCD>
<SndTP>FSCS</SndTP>
<RcvTPQualCD>ZZ</RcvTPQualCD>
<RcvTP>EIB</RcvTP>
<SndSrc>YANTRA</SndSrc>
<RcvSrc>EIB</RcvSrc>
<UsrID>VAR</UsrID>
</FXNHdrLp>
<ProdRcptHdrLp>
<ShpID>VAR20070612NCHIC1</ShpID>
<ShpTyp> </ShpTyp>
<ShpActnCD>00</ShpActnCD>
<InTransMrgTyp> </InTransMrgTyp>
<ShpVolUOM>CI</ShpVolUOM>
<ShpWgtUOM>LB</ShpWgtUOM>
<ShpTotVol>310022.00</ShpTotVol>
<ShpTotWgt>861.00</ShpTotWgt>
<DtTmLp>
<DtTyp>050</DtTyp>
<DtTmQual>501</DtTmQual>
<DtTm>2007-06-12T15:07:41-04:00</DtTm>
</DtTmLp>
<AdrLp>
<EntTyp>RC</EntTyp>
<EntIDQual>93</EntIDQual>
<EntID>NCHIC</EntID>
<EntNm>NCHIC</EntNm>
<AutoCrtTrdPar>0</AutoCrtTrdPar>
<AutoCrtTrdParRole>0</AutoCrtTrdParRole>
<AutoUpdtTrdPar>0</AutoUpdtTrdPar>
</AdrLp>
<ProdRcptTptLp>
<TptIDQual>BOL</TptIDQual>
<TptSCAC> </TptSCAC>
<TptID> </TptID>
Thanks and Best Regards
SitaramanYou could try to use the following coding:
*& Report ZUS_SDN_UC_XML_TO_UTF8_TRANSF
REPORT zus_sdn_uc_xml_to_utf8_transf.
define local data
CONSTANTS:
gc_encoding TYPE string VALUE 'UTF-8'.
DATA:
gd_result type string,
go_ixml TYPE REF TO if_ixml,
go_stream_factory TYPE REF TO if_ixml_stream_factory,
go_encoding TYPE REF TO if_ixml_encoding,
go_resstream TYPE REF TO if_ixml_ostream.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gd_xml TYPE string,
gt_xml TYPE TABLE OF string.
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1 UP TO 10 ROWS
WHERE bukrs = '1000'.
go_ixml = cl_ixml=>create( ).
go_stream_factory = go_ixml->create_stream_factory( ).
go_encoding = go_ixml->create_encoding( character_set = gc_encoding
byte_order = 0 ).
go_resstream =
go_stream_factory->create_ostream_cstring( gd_result ).
CALL METHOD go_resstream->set_encoding
EXPORTING
encoding = go_encoding.
XML Transformieren
CALL TRANSFORMATION id_indent
SOURCE itab = gt_knb1
RESULT XML go_resstream.
APPEND gd_result TO gt_xml.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
BIN_FILESIZE =
filename = 'C:\temp\xml_to_utf8.txt'
FILETYPE = 'ASC'
APPEND = SPACE
WRITE_FIELD_SEPARATOR = SPACE
HEADER = '00'
TRUNC_TRAILING_BLANKS = SPACE
WRITE_LF = 'X'
COL_SELECT = SPACE
COL_SELECT_MASK = SPACE
DAT_MODE = SPACE
CONFIRM_OVERWRITE = SPACE
NO_AUTH_CHECK = SPACE
CODEPAGE = SPACE
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = SPACE
TRUNC_TRAILING_BLANKS_EOL = 'X'
IMPORTING
FILELENGTH =
CHANGING
data_tab = gt_xml
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
END-OF-SELECTION.
However, I like to mention that the file created from out ECC 5.0 (6.40, non-Unicode) contains a special character between the XML header and the data part (when displayed using NotePad Editor):
...xml version="1.0" encoding="utf-8"?>[special character]<asx:abap xmlns:asx="http://www.sap.com/a...
Using a HexEditor the special character (0x0A) is displayed as a dot.
Also Check with FM - TREX_TEXT_TO_UTF8
Reward Points if it is helpful
Thanks
Seshu -
Muse and eCommerce without Coding
We have created small sites using DW but not being coders prefer to use Muse where possible.
We have been asked to create a new ecommerce site for a client. The products are all downloadable files; there are no physical products to fulfill. They have a site that already sells some of their products but they want to move away from the current proprietary ecommerce solution and web design combination.
The BC eCommerce option looks attractive but I want to be sure we can deliver before saying yes to the client. These are my concerns:
How easy is it to create the forms necessary to expedite payments etc without coding, is an understanding of PHP required?
We will inherit the existing payment gateway. What are the technical issues involved in payment processing?
We have a Creative Cloud/CS6 subscription and last time I enquired the BC that this uses seemed to be on a different track to the standalone BC, is this still the case?
Sorry for being a bit long-winded but I couldn’t compress my questions any further.
PS. Is there an option for a subscription based model for downloading products to run in conjunction to a payment per download one?Hi Graham,
Checkout forms are a built in part of BC, no PHP coding required.
The payment gateways currently supported are: http://www.businesscatalyst.com/features/payment-gateways
To build a webcommerce site you have to setup a new bc account, as current creative cloud subscriptions offer free webBasics sites that can not be upgraded. Here's some info on the partner program as well: http://www.adobe.com/uk/products/business-catalyst/faq.html#partner-program
Products inside the commerce module can be marked as downloadable files right out of the box.
Regarding the posibility of adding a subscription based model, you could setup subscribing customers as wholesalers and set a wholesaler price as well for all products( of value "0")
Kind Regards,
Alex -
Hi all
i have one requirement , when i submit the form in webdynpro by filling with some data and click the submit button then data has to be stored in the ECC/SRM system by calling required BAPI.
can you help me out , is there any coding required for the same in webdynpro application?
Regards
Suresh babuDear Sunil,
You can use AdaptiveRFC Model by creating models in webdynpro,
1. You will find Models image in dark blue in list.
2. right click on it,
3. create model.
4. import Adaptive RFC Model.
5. Give a name for that model.
6. give WD_MODELDATA_DEST and WD_RFC_METADATA_DEST change this to customised in logical system name by typing there.
7. click next
8. enter host name of your ECC/SRM system.
9. system no,
10. client no.
11. user ID for the system (can be any user ID who has access to Function Modules or bapi)
12. user's password
13. search bapi name in function module with *.
14. select the required bapi's from the list by ticking them.
15. click finish.
the model is ready to be used.
1. go to component controller.
2. right click.
3. right click, template apply, service controller.
4. choose the bapi for execution from the models list.
5. it gives the execution method which will be created in component controller.
6. finish.
double click on component controller
go to method.
organise import.
now,
go to diagram view of component.
you will find the connection between model and component controller.
connect between view and component controller.
drag and drop the model node from component controller.
the model node will be created in your iview.
to set values of table before executing bapi you need to create object of that model node.
Thanks...
-Mohak... -
Dear friends,
In my business scenario i create interaction record for every call to any customer and i create follow up activity like visit or appointment to this customer but some times i want the system to stop the user if he create two visits with the same time in any calendar of any employee.
Best Regards,
MohamedHello Mohamed,
ORDER_SAVE Badi is called during saving. Here can you
implement (Meth CHECK_BEFORE_SAVE) your own coding / requirement.
Regards,
Reshma Rao -
Field Catolgue in alv grid display
Hi Abapers,
I need to display the percentage rows with decimals and other rows without decimal . Is their any option in field catalog to do like this. Or tell me any other alternative to achieve this.
sno total col1 col2 col3
1 220 100 20 100
2 320 120 50 150
tot 540 220 70 250
per 40.74 1.87 and so on
or ,
I have two different internal tables how can i put it in one field catalog to pass it to alv grid display.
Regards,
PriyaDon't do total by your self in the Pogram.
in the Fieldcatalog there is an Attribute which will do total & Average .
Enable it so that from one internal table data it self it will do good.
example program
Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
display it using the basic ALV grid functionality(including column total). The example details the main
sections of coding required to implement the ALV grid functionality:
Data declaration
Data retrieval
Build fieldcatalog
Build layout setup
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
form build_fieldcatalog.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
* gd_layout-totals_only = 'X'.
* gd_layout-f2code = 'DISP'. "Sets fcode for when double
* "click(press f2)
* gd_layout-zebra = 'X'.
* gd_layout-group_change_edit = 'X'.
* gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
* i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
* i_callback_user_command = 'USER_COMMAND'
* i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
* it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
tables
t_outtab = it_ekko
exceptions
program_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.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL
gowri
Message was edited by:
Gowri Krishna -
ALV report using the field catalog
which is the quickest way to generate an ALV report using the field catalog merge. without needing to build the field catalog manually .
is it easier to create a structure and passe it in the field catalog merge . if yes can i have an example plzzzzhI
Supports the creation of the field catalog for the ALV function modules
based either on a structure or table defined in the ABAP Data
Dictionary, or a program-internal table.
The program-internal table must either be in a TOP Include or its
Include must be specified explicitly in the interface.
The variant based on a program-internal table should only be used for
rapid prototyping since the following restrictions apply:
o Performance is affected since the code of the table definition must
always be read and interpreted at runtime.
o Dictionary references are only considered if the keywords LIKE or
INCLUDE STRUCTURE (not TYPE) are used.
If the field catalog contains more than 90 fields, the first 90 fields
are output in the list by default whereas the remaining fields are only
available in the field selection.
If the field catalog is passed with values, they are merged with the
'automatically' found information.
Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
display it using the basic ALV grid functionality(including column total). The example details the main
sections of coding required to implement the ALV grid functionality:
Data declaration
Data retrieval
Build fieldcatalog
Build layout setup
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
form build_fieldcatalog.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
* gd_layout-totals_only = 'X'.
* gd_layout-f2code = 'DISP'. "Sets fcode for when double
* "click(press f2)
* gd_layout-zebra = 'X'.
* gd_layout-group_change_edit = 'X'.
* gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
* i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
* i_callback_user_command = 'USER_COMMAND'
* i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
* it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
tables
t_outtab = it_ekko
exceptions
program_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.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL -
Opening and fetching cursor.. what accually happens?
So, if we have an explicit cursor... we open it with open c_cursor_name... and fetches it into some variable...
my question is - what really happens when we open cursor?
does oracle make only instance of cursor object in memory? or... does it reads some basic data about rows that are going to be fetched (rowid's?)..? or what?
also, if we make some insert into a table that is going to be rolled over by cursor (while cursor is fetching..), should cursor read this new data? for example, what is difference if cursor roll over an indexed ID and we make an insert with an ID=10, and cursor is currently on ID=100? or opposite? (commit included in insert)...
oh, so many questions :)
tnx :)Not really. The same SQL cursor in the shared pool applies.
The difference is on the client side. Each of the methods you've listed is essentially using a different method on the client side to interact with the cursor on the server.
Some methods are more desirable in some cases than another - there's not a single superior method. Each has pros and cons and addresses a specific set of client coding requirements.
There are some preferred methods though on the client. The three primary ones are:
a) use bind variables (enables one to re-use the same SQL cursor)
b) re-use the same client cursor handle for tight loop operations
c) use bulk binding
The first one is kind of obvious - as bind variables creates a cursor "program" that can be called/executed with different values. Like an INSERT cursor for example. The same SQL cursor can be used to insert a million rows, with each execution using different variable values to insert.
The second one is not that applicable to the PL language in PL/SQL - thanks to the integration between the PL and SQL languages. In other client languages though, you want to re-use not only the same server cursor, but the same client cursor handle. As this saves you a soft parse. So instead of this approach:
// pseudo code
for i in 1..count
CreateCursor( c, <sql statement> );
BindValue( c, 1, myVariable[i] );
ExecCursor( c );
CloseCursor( c );
end loop;..the following is far more efficient:
// pseudo code
CreateCursor( c, <sql statement> );
for i in 1..count
BindValue( c, 1, myVariable[i] );
ExecCursor( c );
end loop;
CloseCursor( c );This approach re-uses the client handle - which means a single db parse was needed. The prior approach required a brand new parse for each loop iteration. (even soft parsing is an overhead that should be avoided where possible)
The last primary factor is bulk processing. This is fairly well documented for the PL language - the important bit to remember that bulk processing is only intended to pass more data with a single call between the PL and SQL engines. Nothing more. The price of which is a bigger PGA memory footprint. Thus there is a balance between how much data (rows/variables) one should pass between the two versus the amount of memory that consumes. -
Submit background job for a report
Hai Friends,
I want to submit a report in background which should run on first monday of every month. otherthen SM36 and SM37. Because we cant give date and time like this.
If any coding required Pl give me the code.
regards,
vamsykrishna.This is the Basic code to Achieve that.
Call Function 'JOB_OPEN'
SUBMIT RSBDCBTC
via background Job <Job info>
With QIE = <QID Returned by BDC_OPEN_Group FM>
AND RETURN.
Call Function 'JOB_CLOSE'
2) Also go through this
DATA: lv_job_name LIKE tbtco-jobname,
lv_job_nr LIKE tbtco-jobcount,
lv_job_released TYPE c,
lv_job_start_sofort TYPE c,
lv_print_parameters TYPE pri_params.
lv_job_name = 'Z_BGPROGRAM'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = lv_job_name
IMPORTING
jobcount = lv_job_nr
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF syst-subrc = 0.
" submit job with all the selection screen params...
SUBMIT (lv_job_name)
WITH applfile = applfile " these are the parameters of the background program
WITH p_lines = p_lines
USER syst-uname " you must use this
VIA JOB lv_job_name NUMBER lv_job_nr AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = lv_job_nr
jobname = lv_job_name
strtimmed = 'X'
IMPORTING
job_was_released = lv_job_released
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF syst-subrc <> 0.
MESSAGE i162(00) WITH
'An error occured while closing the background job.'.
STOP.
ENDIF.
ENDIF.
ENDIF.
SKIP 1.
WRITE: / 'Background process', lv_job_name , 'called successfully' NO-GAP.
WRITE: / 'You can check the job in transaction SM37'.
Maybe you are looking for
-
How do I get the songs on my ipod to a new installation of ITunes
I keep Itunes on my corporate PC and I just received a new PC after the old one crashed. I installed ITunes and connected my IPod Nano and was saw a window that indicated my Ipod was linked to a different library and I would like to change. It would
-
I am relatively new to XML / JAXP technologies and was wondering if there is a syntax available that would permit retrieving a node by specifying the ancestory of the node? For example, if I had the following XML: <?xml ?> <person name="Daffy"> <addr
-
Passing two variables in the body of the URL using the go to detail page SB in ASP
Hi all, Would appreciate your assistance with the following, I'm trying to set up a go to detail page sb that passes two variable in the body of the URL rather than the standard one. The code i've tried is - <td><A HREF="gggggggtest.asp?<%= Server.HT
-
CF7 and JDK 1.4.2 - EV SSL Certificate Issue
Let me start off by telling the group that we do not use CF for any of our applications. We are a payments company that hosts a .NET API in IIS that 100's of thousands of customer use. We have one particular customer using CF7 and JDK 1.4.2 who is
-
Lumia 822 camera has greenish tint indoors
My Nokia Lumia 822 camera has a greenish tint when used indoors. Outside seems OK. I heard a fix was coming but every time I click on Phone Update, it says my phone is up to date. Any info on when I can expect a fix? Solved! Go to Solution.