How to use bdc code in a report for save button
hi to all can anybody please give some hints that how can i place the BDC code for the save button to pass the values from the editable grid to the standard table here i am sending my code .please advice me.
Moderator Message: Please post only relevant portions of your code. There is a 2,500 character per post limit.
here the second grid is editable.and i have to make changes in the second grid and save it to the standard tables. please advice me resma
Edited by: kishan P on Sep 13, 2010 3:59 PM
Hi,
I have done that many times. Create a button in the toolbar,say 'SAVE'. Write the code in the subroutine user command.For example :
*& Form USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA : REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: L_VALID TYPE C.
*Code to reflect the changes done in the internal table
IF REF_GRID IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF_GRID.
ENDIF.
IF NOT REF_GRID IS INITIAL.
CALL METHOD REF_GRID->CHECK_CHANGED_DATA
IMPORTING
E_VALID = L_VALID.
ENDIF.
CASE SY-UCOMM.
WHEN 'SAVE'.
PERFORM BDC."Write all you BDC code in this subroutine
ENDCASE.
ENDFORM.
Hope this will help.
Thanks & Regards,
Rock.
Similar Messages
-
How to use stored procedure in crystal report for eclipse
Hi;
I am working on crystal report for eclipse 2.0 and trying to use stored procedure in report .It is created from Oracle but it is not showing any dependencies
CREATE OR REPLACE procedure ACT_DB.getCostTransferDetails
p_In_Contract_ID varchar2 DEFAULT '*',
p_In_Status_ID varchar2 DEFAULT '*',
p_In_COST_TRAN_DATE varchar2 DEFAULT '*',
p_In_DEPT_ID varchar2 DEFAULT '*',
p_In_PROJECT_ID varchar2 DEFAULT '*',
p_In_EMPLOYEE_ID varchar2 DEFAULT '*',
p_Out_CostTransfer_Cusor OUT COST_TRANSFER_PACKAGE.COST_TRANSFER_TYPE
AS
BEGIN
OPEN p_Out_CostTransfer_Cusor FOR
SELECT
header.cost_tran_id,
header.cost_tran_date,
header.total_credit_amount,
header.total_debit_amount,
header.transfer_status,
header.updated_by,
header.added_by,
header.trf_over_ninety_days,
header.business_unit_id,
header.equip_approval,
header.batch_desc,
details.opr_unit_id,
status.status_id,
details.fund_code_id,
details.prgm_code_id,
details.class_id,
details.activity_id,
details.product_id,
details.status_id,
details.transaction_amount,
details.jrnl_date,
details.adjust_prcnt,
details.adjust_amnt,
details.details_equip_approval,
details.detail_desc,
details.account_id,
details.project_id,
details.dept_id,
details.contract_id,
details.reason_code_id,
details.jrnl_id,
employee.f_name,
employee.l_name,
employee.employee_id,
project.project_id,
project.project_status,
--header.transfer_status,
contracts.contract_desc
FROM header, details, status, employee, department, project, contracts
WHERE (header.cost_tran_id = details.cost_tran_id)
AND (header.cost_tran_date = details.cost_tran_date)
AND (header.transfer_status = status.status_id)
AND (department.dept_id = details.dept_id)
AND (department.dept_id = employee.dept_id)
AND (project.project_id = details.project_id)
AND (contracts.contract_id = details.contract_id)
AND (details.Contract_ID = p_In_Contract_ID OR p_In_Contract_ID ='*' )
AND (header.TRANSFER_STATUS = p_In_Status_ID OR p_In_Status_ID ='*' )
AND (TO_CHAR(details.COST_TRAN_DATE, 'MM/DD/YYYY') = p_In_COST_TRAN_DATE OR p_In_COST_TRAN_DATE ='*' )
AND (details.DEPT_ID = p_In_DEPT_ID OR p_In_DEPT_ID ='*' )
AND (details.PROJECT_ID = p_In_PROJECT_ID OR p_In_PROJECT_ID ='*' )
AND (header.ADDED_BY = p_In_EMPLOYEE_ID OR '*'=p_In_EMPLOYEE_ID )
Can any another way to make procedure
Thanx
Regards ,
AmolHi Amol,
Are you able to execute your stored procedure from oracle?.
- If "Yes" then use the Crystal Report XIR2 Designer to create the report.
- Import this report in the Crystal Report For Eclipse Workbench.
- The latest version for Crystal Report For Eclipse is SP1.
Please let me know the results.
Thanks,
Neeraj -
How to use intractive list in Alv REPORT
how to use intractive list in Alv REPORT with example.
thangs
venki.......Hi
using the USER_COMMAND we can move to the Secondary(interactive) list in the ALV
see the sample code
report yh645_secndry_alv.
type-pools: slis.
data: fieldcat type slis_t_fieldcat_alv,
fieldcat_ln like line of fieldcat,
fs_layout type slis_layout_alv,
t_layoout like standard table
of fs_layout.
data: begin of fs_spfli,
carrid type spfli-carrid,
connid type spfli-connid,
countryfr type spfli-countryfr,
cityfrom type spfli-cityfrom,
airpfrom type spfli-airpfrom,
countryto type spfli-countryto,
cityto type spfli-cityto,
airpto type spfli-airpto,
fltime type spfli-fltime,
deptime type spfli-deptime,
arrtime type spfli-arrtime,
distance type spfli-distance,
distid type spfli-distid,
fltype type spfli-fltype,
period type spfli-period,
checkbox,
color(3),
end of fs_spfli.
data:
begin of fs_table,
carrid type spfli-carrid,
connid type spfli-connid,
end of fs_table.
data: begin of fs_sflight,
check,
color(3).
include type sflight.
data:end of fs_sflight.
data:
begin of fs_table1,
carrid type sflight-carrid,
connid type sflight-connid,
fldate type sflight-fldate,
end of fs_table1.
data:
t_spfli like standard table
of fs_spfli.
data:
t_table like standard table
of fs_table.
data:
t_table1 like standard table
of fs_table1.
data:
t_sflight like standard table
of fs_sflight.
data:
t_sbook like standard table
of sbook.
data t_layout type slis_layout_alv.
select *
into corresponding fields of table t_spfli
from spfli.
perform start_list_viewer.
perform get_spfli_details.
*& Form SUB1
text
-->RT_EXTAB text
form sub1 using rt_extab type slis_t_extab.
data: flight type slis_extab.
flight-fcode = 'SFLIGHT'.
append flight to rt_extab.
set pf-status 'SFLIGHT'. " EXCLUDING RT_EXTAB.
endform. "SUB1
*& Form START_LIST_VIEWER
text
--> p1 text
<-- p2 text
form start_list_viewer .
data: pgm like sy-repid.
pgm = sy-repid.
fs_layout-box_fieldname = 'CHECKBOX'.
fs_layout-info_fieldname = 'COLOR'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = pgm
i_callback_pf_status_set = 'SUB1'
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'SPFLI'
is_layout = fs_layout
tables
t_outtab = t_spfli
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. " START_LIST_VIEWER
*******Process Call Back Events (Begin)**************************
form user_command using ucomm like sy-ucomm
selfield type slis_selfield.
case ucomm.
when 'SFLIGHT'.
selfield-refresh = 'X'.
perform get_spfli_details.
select *
from sflight
into corresponding fields of table t_sflight
for all entries in t_table
where carrid eq t_table-carrid
and connid eq t_table-connid.
perform display_sflight.
when 'SBOOK'.
selfield-refresh = 'X'.
perform get_sflight_details.
select *
from sbook
into corresponding fields of table t_sbook
for all entries in t_table1
where carrid eq t_table1-carrid
and connid eq t_table1-connid
and fldate eq t_table1-fldate.
perform display_sbook.
endcase.
endform. "USER_COMMAND
*& Form SUB2
text
-->RT_EXTAB text
form sub2 using rt_extab type slis_t_extab.
data: flight type slis_extab.
flight-fcode = 'SBOOK'.
append flight to rt_extab.
set pf-status 'SBOOK'. " EXCLUDING RT_EXTAB.
endform. "SUB2
*& Form DISPLAY_SFLIGHT
text
--> p1 text
<-- p2 text
form display_sflight .
data: pgm like sy-repid.
pgm = sy-repid.
clear t_layout.
fs_layout-box_fieldname = 'CHECK'.
fs_layout-info_fieldname = 'COLOR'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = pgm
i_callback_pf_status_set = 'SUB2'
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'SFLIGHT'
is_layout = fs_layout
tables
t_outtab = t_sflight
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_SFLIGHT
*& Form GET_SPFLI_DETAILS
text
--> p1 text
<-- p2 text
form get_spfli_details .
loop at t_spfli into fs_spfli.
if fs_spfli-checkbox = 'X'.
fs_spfli-color = 'C51'.
fs_spfli-checkbox = '1'.
fs_table-carrid = fs_spfli-carrid.
fs_table-connid = fs_spfli-connid.
append fs_table to t_table.
modify t_spfli from fs_spfli.
endif.
endloop.
endform. " GET_SFLIGHT_DETAILS
*& Form GET_SFLIGHT_DETAILS
text
--> p1 text
<-- p2 text
form get_sflight_details .
loop at t_sflight into fs_sflight.
if fs_sflight-check = 'X'.
fs_sflight-color = 'C71'.
fs_sflight-check = '1'.
fs_table1-carrid = fs_sflight-carrid.
fs_table1-connid = fs_sflight-connid.
fs_table1-fldate = fs_sflight-fldate.
append fs_table1 to t_table1.
modify t_sflight from fs_sflight.
endif.
endloop.
endform. " GET_SFLIGHT_DETAILS
*& Form DISPLAY_SBOOK
text
--> p1 text
<-- p2 text
form display_sbook .
data: pgm like sy-repid.
pgm = sy-repid.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = pgm
i_structure_name = 'SBOOK'
tables
t_outtab = t_sbook
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_SBOOK
Reward points for useful Answers
Regards
Anji -
How to use a parameter of a report program in a dialog program
how to use a parameter of a report program in a dialog program.
I have to fetch the value entered in the parameter of report program and display it in a dialog programHi Aasim,
Just mention like below in your ABAP report.
PARAMETERS: p_aufnr TYPE aufnr MEMORY ID ord.
and mention the same memory ID name in the module pool screen property it automatically populates the value to and fro -
How to use a parameter in a report program in a dialog program
how to use a parameter in a report program in a dialog program
Hi Shaikh,
Post it in http://scn.sap.com/community/abap
"ABAP Development".
sree -
How to use advanced tab in user reports?
Hi,
How to use "advanced" tab in user reports?
I have two reports. I fill "Report ID" in both and then I can push "Add Report" and fill fields property.
Then I'm can "drill" from one report to another on right click, but how to pass parameters?
Is it even possible?
Regard
LiborThank you for reply.
I can't get it working.
I have two reports:
1. report:
Name: test
SQL: select 1 NUM, 'text' TEXT from dual;
On advanced tab:
ReportID: -null-
Name: test2
Report: Test2
2. report
Name: test2
SQL: select :NUM from dual;
Now, when I run the first report and click do right click on a row and select TEST2
from popup menu, it navigates to the second report test2, but WITHOUT actual value
from NUM column from first report.
I'm using latest version of SQL Developer (1.1.1.25) and I like reports.
With this feature it would be even better.
Regards
Libor -
How to use Java code inside WebDynpro-ABAP
Hi,
How to use Java code inside WebDynpro-ABAP.
Could any one provide sample code.
Cheers,
SamHi Sam,
We can't Bring Java Inside the ABAP. Both are running in different Environments.
and also ABAP Codes are runs on BASIS.
-Basis is a middleware between ABAP codes and Ur OS.
-Contains set of programs to load,RUN,intepret the ABAP program..
So Both are Different.
Regards,
Ramganesan K. -
How to use pramotional code in iStore?
Hi,
We have added promotional code. Its for 10% discount. But as we add code number still at item level discount is not calculated.
So if any setup is missing plz tell. We are using 11i.
Regards,
AshishHello Ashish,
Confirm your setups are as per the example in:
How to use Promotion Codes in iStore Shopping Cart (Doc ID 156009.1)
Check qualifiers on this modifier -
Remove and re-add one by one to determine if any are problematic
Please check above items to isolate possible setup issues.
Regards,
Debbie -
How to use content code to redeem mountain lion
when i had enter content code in redeem option its showing i have to make a payment method. tell me how to use content code to redeem mountain lion osx
Correction- you have to put the content code into the PDF file Apple sent you as the password to open the PDF then the redemption code is shown.
-
How To Use PMD Code Checker in Jdeveloper 9
Hai
Please Any one tell me How To Use PMD Code Checker in Jdeveloper 9
ThanksTimo
You Checking file with PMD in **Jdeveloper** possible in jdev 10.1.3
for the earlier versions you told me to use command prompt
that's why when iam checking my file with pmd the output is like the below:
D:\jdev9\OAF\jdevbin\jdev\lib\ext\pmd-bin-4.2.5\pmd-4.2.5\java14\bin>pmd D:/satyas/Test.java xml rulesets/unusedcode.xml -debug
In JDK 1.5 mode
Loaded rule UnusedPrivateMethod
Loaded rule UnusedPrivateField
Loaded rule UnusedFormalParameter
Loaded rule UnusedLocalVariable
Processing D:\satyas\Test.java
Could not find class Test, due to: java.lang.ClassNotFoundException: Test
<?xml version="1.0" encoding="UTF-8"?>
<pmd version="4.2.5" timestamp="2010-08-24T19:02:07.019">
<file name="D:\satyas\Test.java">
<violation beginline="5" endline="5" begincolumn="22" endcolumn="22" rule="UnusedLocalVariable" ruleset="Unused Code Rules" class=
"Test" method="main" variable="i" externalInfoUrl="http://pmd.sourceforge.net/rules/unusedcode.html#UnusedLocalVariable" priority=
"3">
Avoid unused local variables such as 'i'.
</violation>
<violation beginline="14" endline="14" begincolumn="23" endcolumn="32" rule="UnusedPrivateMethod" ruleset="Unused Code Rules" clas
s="Test" method="myMethod" externalInfoUrl="http://pmd.sourceforge.net/rules/unusedcode.html#UnusedPrivateMethod" priority="3">
Avoid unused private methods such as 'myMethod()'.
</violation>
</file>
</pmd> -
how to use puk-code to start
Sorry, same situation. If you want to use the iphone as an iPod, you'll have to have a supported SIM.
If you have, follow this article:
Using an iPhone without a wireless service plan - Apple Support -
Can anyone tell me how to use GUI status in ALV report.
Can anyone tell me how to use GUI status in ALV report. I want to use buttons in ALV report.
Juheb,
see the link
http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
Adding a button on the ALV grid using OOPs
check these sites.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-ALVControllingStandard+Buttons&
chk this.
alv-pfstatus:
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_pfstatus.htm
then how to capture that button click.
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_ucomm.htm
REPORT ZTESTALV.
TYPE-POOLS: SLIS.
*- Fieldcatalog
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV..
*- For Events
DATA:IT_EVENTS TYPE SLIS_T_EVENT.
DATA: X_FIELDCAT TYPE LVC_S_FCAT,
X_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.
DATA:X_LAYOUT TYPE LVC_S_LAYO.
"{ FOR DISABLE
DATA: LS_EDIT TYPE LVC_S_STYL,
LT_EDIT TYPE LVC_T_STYL.
"} FOR DISABLE
DATA: BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
HANDLE_STYLE TYPE LVC_T_STYL, "FOR DISABLE
<b> BUTTON(10),</b>
END OF IT_VBAP.
DATA: LS_OUTTAB LIKE LINE OF IT_VBAP.
SELECT VBELN
POSNR
UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
FROM VBAP.
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
<b>X_FIELDCAT-SELTEXT = 'Button'.
x_fieldcat-fieldname = 'BUTTON'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-style = X_FIELDCAT-style bit-xor
cl_gui_alv_grid=>MC_STYLE_BUTTON bit-xor
cl_gui_alv_grid=>MC_STYLE_ENABLEd.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.</b>
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'VBELN'.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
x_fieldcat-ref_field = 'VBELN'.
x_fieldcat-ref_table = 'VBAK'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'POSNR'.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
"{FOR DISABLE HERE 6ROW IS DISABLED
SY-TABIX = 6.
LS_EDIT-FIELDNAME = 'VBELN'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 10.
INSERT LS_EDIT INTO TABLE LT_EDIT.
*LS_EDIT-FIELDNAME = 'POSNR'.
*LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
*LS_EDIT-STYLE2 = SPACE.
*LS_EDIT-STYLE3 = SPACE.
*LS_EDIT-STYLE4 = SPACE.
*LS_EDIT-MAXLEN = 6.
*INSERT LS_EDIT INTO TABLE LT_EDIT.
INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
MODIFY IT_VBAP INDEX SY-TABIX FROM LS_OUTTAB TRANSPORTING
HANDLE_STYLE .
X_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
"} UP TO HERE
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT_LVC = X_LAYOUT
IT_FIELDCAT_LVC = IT_FIELDCAT
TABLES
T_OUTTAB = IT_VBAP[]
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.
Don't forget to reward if useful.... -
How to use views in sql script report?
All all
Can any one tell how to use views in sql script report?Most of the views are based on tables (or other views which are based on tables).
The view typically shows one org at a time based on the context that is set.
If you need records for all orgs, you need to use the underlying tables. Oracle typically names the tables with a _all suffix.
e.g. PO_HEADERS will show records for one org at a time. PO_HEADERS_ALL will show records for all orgs.
Hope this answers your question,
Sandeep Gandhi -
How to use dynamic parameter when a report is created using Stored Procedures
Hi all,
any one have the idea of how to use dynamic parameter in crystal report XI R2
when report is created using Stored Procedure.
Regards
shashi kant chauhanHi
You can create an SQL command in Database Expert > Expand your datasource > Add command
Then enter the SQL query that will create the list of values to supply to the user
eg select field1,field2 from table
Then edit the parameter of the report. These will be the SP parameters adn can be seen in field explorer.
Change the parameter type to Dynamic
Under the word Value click on Click here to add item
Scroll down to your Command and select one of the values that you want to appear in the list
e.g field1
Then click on the Parameters field - this is essential to create the param
You can edit other options as required
That should do it for you.
I must say that i use CR 2008 connected to Oracle 10g SP, but i reckon this will work for SQL DB and CR XI as well
Best of luck -
I have iphone 4 with virgin mobile canada, virgin provided me SIM unlock code online, but i don't know how to use that code to unlock my phone. Can anyone help me in this?
That's not how unlocking an iPhone works.
The carrier the phone is locked to submits a request to Apple, wh updates their database. When that is complete, you restore the phone with iTunes to process the unlock.
Maybe you are looking for
-
How to map single to multiple record in Biztalk Map
Hi, I have a flat file Input as below For understandability I am making it as XML: <Input> <Name>vignesh</Name> <Country>India</Country> <orderNumber>123<orderNumber> </Input> I am having a look up table to retrieve multiple LineItem per Name Output
-
WD Exception when pointing ESS Travel & Expense to multiple backend systems
Hi All, I have a query regarding ESS Travel Management pointing to multiple backend systems. ESS MSS is installed on a single portal(Portal1). ESS MSS is currently pointing to Backend System1. The requirement is that ESS Travel from Portal1 should po
-
I am urgently trying to send out my newsletter and am receiving "Web Page Redirection Messages" when clicking on any external links from the email. This is my 23rd monthly newsletter and it has never happened before. The major problem is I have busin
-
I have a MacBook Pro3 and since I have a triple boot there I am unable to spare a partition for swap space, so I use swap in tmpfs (problem is the same with swap file). However, i want to be able to suspend to disk: is there a way to suspend to a fil
-
Having trouble installing Boot Camp
I'm having trouble installing Boot Camp and I'm not sure how I can do it. I get the "can't move files" when I try to partition. I purchased and tried to run iDefrag, that didn't work, it gave me an error. I have used Carbon Copy Clone to clone to an