Trigerring Outbound XI interface from a report program
Hi All,
I have scenario which requires an outbound interface to be triggered from a report program.
I followed the approach given in
/people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
when i am excuting the report program and checked in the sxmb_moni for the status of the message, even though the payload is ok, but the status of the message is failed with msg saying Reciever is not configured.
Since i have only one Outbound interface, so while configuring the integration builder, i can only specify the name for outbound interface but it asks for even inbound interface which i don't have?
Can you please suggest the soultion?
Regards,
Kulwant Singh
Dear kulwant,
From report there are 2 ways of trigerring messages to XI.
Method 1:(busines system running on web as>=6.20
Create proxy for your outbound interface, it generates proxy class in your local IE system(Business system).
once the proxy is generated, you can test it.select the class & click on exucute button located on menu bar.
fill the values and say execute,(for ASyn only).
<b><u>Calling in report</u></b>
Then call the proxy class in your report and fill the values
for ASN: EXECUTE_ASYNCHRONOUS
FOR SYN: EXECUTE SYNCHRONOUS.
Method 2: business system running or 4.6/47 webas in not there
You need to create RFC import the RFC in IR use it as MI(Outbound/syn/asn)
Use the program ID created for RFC communication channel, and create a TCPIP
connection in your business system and use the program id as registerd server program.
Then call the RFC in your report program.
it will work.
regards
chandra
Similar Messages
-
Create a url from a report program
Hi All,
Could anyone please suggest me how do i generate a url from a report program. I need to use this generated url then, as a link in an excel sheet.
Thanks in advance,
Warm Regards,
Preethi.Hi Preethi,
REPORT ZAZUURL .
DATA: BEGIN OF URL_TABLE OCCURS 10,
L(25),
END OF URL_TABLE.
URL_TABLE-L = 'http://www.lycos.com'.APPEND URL_TABLE.
URL_TABLE-L = 'http://www.hotbot.com'.APPEND URL_TABLE.
URL_TABLE-L = 'http://www.sap.com'.APPEND URL_TABLE.
LOOP AT URL_TABLE.
SKIP. FORMAT INTENSIFIED OFF.
WRITE: / 'Single click on '.
FORMAT HOTSPOT ON.FORMAT INTENSIFIED ON.
WRITE: URL_TABLE. HIDE URL_TABLE.
FORMAT HOTSPOT OFF.FORMAT INTENSIFIED OFF.
WRITE: 'to go to', URL_TABLE.
ENDLOOP.
CLEAR URL_TABLE.
AT LINE-SELECTION.
IF NOT URL_TABLE IS INITIAL.
CALL FUNCTION 'WS_EXECUTE'
EXPORTING
program = 'C:\Program Files\Internet Explorer\IEXPLORE.EXE'
commandline = URL_TABLE
INFORM = ''
EXCEPTIONS
PROG_NOT_FOUND = 1.
IF SY-SUBRC <> 0.
WRITE:/ 'Cannot find program to open Internet'.
ENDIF.
ENDIF.
<b>Regards,
Azhar</b> -
How to pass values to a module pool program from another Report Program
Hi ..
Please let me know how I can pass values to a MODULE POOL selection screen field from another Report Program.
Thanks
RKhttp://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/frameset.htm
a® -
Can we call a bdc from a report program?
hi
Can we call a bdc from a report program?
Thanks
RamaHello,
Yes..
Check this example:
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA : L_EBELN TYPE EKPO-EBELN,
L_EBELP TYPE EKPO-EBELP.
DATA : L_DATE1 TYPE SY-DATUM,
L_DATE2 TYPE SY-DATUM,
L_YEAR(4),
L_MONTH(2),
L_DATE(2).
DATA: L_AMOUNT1 LIKE RK40C-WTGBTR.
DATA: L_POSID_OLD TYPE PS_POSID.
DATA: L_POSID_NEW TYPE PS_POSID.
DATA: LS_COBK LIKE COBK.
DATA: LT_ITEMS LIKE RK40C OCCURS 0 WITH HEADER LINE,
LT_COEP LIKE COEP OCCURS 0 WITH HEADER LINE,
LT_COEPL LIKE COEPL OCCURS 0 WITH HEADER LINE,
LT_COEPR LIKE COEPR OCCURS 0 WITH HEADER LINE,
LT_MESG LIKE MESG OCCURS 0 WITH HEADER LINE.
DATA: LV_NUM TYPE POSNR_ACC VALUE '1'.
DATA: CD_SEND_REC_REL LIKE COHEADER-SEND_REC_REL,
LD_STATUS LIKE RK23F-STATUS.
DATA: L_DYNNR LIKE FELD-DYNNR.
CLEAR : L_DATE,L_DATE1,L_DATE2,L_YEAR,L_MONTH.
L_DATE1 = SY-DATUM.
L_YEAR = L_DATE1(4).
L_MONTH = L_DATE1+4(2).
L_DATE = L_DATE1+6(2).
CONCATENATE L_DATE L_MONTH L_YEAR INTO L_DATE2 .
CASE R_UCOMM.
WHEN '&IC1'. "doubleclick
CHECK RS_SELFIELD-FIELDNAME = 'EBELN'.
READ TABLE G_T_FINAL INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
READ TABLE G_T_TEMP WITH KEY LOGNUM = G_T_FINAL-LOGNUM.
IF SY-SUBRC = 0.
MESSAGE I899(KB) WITH TEXT-004.
ELSE.
CLEAR : L_EBELN,L_EBELP,LS_COBK,LT_ITEMS,G_T_BDC,G_T_MESSAGE,
CD_SEND_REC_REL,LD_STATUS.
REFRESH: LT_ITEMS,G_T_BDC,G_T_MESSAGE.
SET PARAMETER ID 'BES' FIELD G_T_FINAL-EBELN.
GET PARAMETER ID 'BES' FIELD L_EBELN.
SET PARAMETER ID 'BSP' FIELD G_T_FINAL-EBELP.
GET PARAMETER ID 'BSP' FIELD L_EBELP.
SORT G_T_FINAL BY EBELN EBELP.
READ TABLE G_T_FINAL WITH KEY EBELN = L_EBELN
EBELP = L_EBELP
BINARY SEARCH.
IF SY-SUBRC = 0.
LS_COBK-KOKRS = G_T_FINAL-KOKRS.
LS_COBK-GJAHR = SY-DATUM+0(4).
LS_COBK-VRGNG = 'RKU1'.
LS_COBK-PERAB = SY-DATUM+4(2).
LS_COBK-PERBI = SY-DATUM+4(2).
LS_COBK-BLDAT = SY-DATUM.
LS_COBK-BUDAT = SY-DATUM.
LS_COBK-CPUDT = SY-DATUM.
LS_COBK-USNAM = SY-UNAME.
LS_COBK-WSDAT = SY-DATUM.
LS_COBK-KURST = 'M'.
LS_COBK-VARNR = '05SAP'.
LS_COBK-KWAER = G_T_FINAL-WAERS.
LS_COBK-CPUTM = SY-UZEIT.
CLEAR : L_POSID_OLD,L_POSID_NEW.
CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'
EXPORTING
INPUT = G_T_FINAL-POSID_NEW
IMPORTING
OUTPUT = L_POSID_NEW.
CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'
EXPORTING
INPUT = G_T_FINAL-POSID_OLD
IMPORTING
OUTPUT = L_POSID_OLD.
L_AMOUNT1 = G_T_FINAL-AMOUNT.
LT_ITEMS-ZLENR = LV_NUM.
LT_ITEMS-EPSPNR = L_POSID_NEW.
LT_ITEMS-SPSPNR = L_POSID_OLD.
LT_ITEMS-KSTAR = G_T_FINAL-KSTAR.
LT_ITEMS-WAERS = G_T_FINAL-WAERS.
LT_ITEMS-WTGBTR = L_AMOUNT1.
LT_ITEMS-WKGBTR = L_AMOUNT1.
APPEND LT_ITEMS.
CLEAR: LT_ITEMS.
* For reposting the Cost
CHECK NOT LT_ITEMS[] IS INITIAL.
CALL FUNCTION 'K40C_COBK_CHECK_POST'
CHANGING
ITCOBK = LS_COBK
EXCEPTIONS
PERIOD_BLOCKED = 1
EXTERNAL_NUMBER_MISSING = 2
ERROR_OCCURED = 3.
IF SY-SUBRC IS INITIAL.
CALL FUNCTION 'K40C_DOCUMENT_LINE_CHECK'
EXPORTING
DOC_HEADER = LS_COBK
IGNORE_WARNINGS = 'X'
TABLES
DOC_ITEMS = LT_ITEMS.
*...Create Tables for database
CALL FUNCTION 'K40C_DOCUMENT_CREATE'
EXPORTING
DOC_HEADER = LS_COBK
TABLES
DOC_ITEMS = LT_ITEMS
ITCOEP = LT_COEP
ITCOEPL = LT_COEPL
ITCOEPR = LT_COEPR.
CALL FUNCTION 'K40C_DOCUMENT_POST'
TABLES
ITCOEP = LT_COEP
ITCOEPL = LT_COEPL
ITCOEPR = LT_COEPR
CHANGING
DOC_HEADER = LS_COBK.
ENDIF.
ENDIF.
IF SY-SUBRC = 0.
GET PARAMETER ID 'KBXXN_P_VAR_RKU1' FIELD CD_SEND_REC_REL.
GET PARAMETER ID 'KBXX_START_DYNPRO' FIELD LD_STATUS.
IF CD_SEND_REC_REL IS INITIAL AND LD_STATUS IS INITIAL.
CLEAR L_DYNNR.
L_DYNNR = '1220'.
PERFORM BDC_DYNPRO USING 'SAPLK23F1' '1200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'COHEADER-SEND_REC_REL'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=PVAR'.
PERFORM BDC_FIELD USING 'COHEADER-SEND_REC_REL'
'05SAP'.
PERFORM BDC_FIELD USING 'RK23F-STATUS'
'L'.
PERFORM BDC_FIELD USING 'COHEADER-BLDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-BUDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-PERIO'
L_MONTH.
PERFORM BDC_DYNPRO USING 'SAPLK23F1' '1200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RK23F-STATUS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=LISI'.
PERFORM BDC_FIELD USING 'COHEADER-SEND_REC_REL'
'05SAP'.
PERFORM BDC_FIELD USING 'RK23F-STATUS'
'S'.
PERFORM BDC_FIELD USING 'COHEADER-BLDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-BUDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-PERIO'
L_MONTH.
PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
ENDIF.
IF CD_SEND_REC_REL EQ '05SAP' AND LD_STATUS EQ 'S'.
CLEAR L_DYNNR.
L_DYNNR = '1220'.
PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
ELSEIF CD_SEND_REC_REL EQ '05SAP' AND LD_STATUS EQ 'L'.
CLEAR L_DYNNR.
L_DYNNR = '1220'.
PERFORM BDC_DYNPRO USING 'SAPLK23F1' L_DYNNR.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RK23F-STATUS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=LISI'.
PERFORM BDC_FIELD USING 'COHEADER-SEND_REC_REL'
'05SAP'.
PERFORM BDC_FIELD USING 'RK23F-STATUS'
'S'.
PERFORM BDC_FIELD USING 'COHEADER-BLDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-BUDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-PERIO'
L_MONTH.
PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
ELSEIF CD_SEND_REC_REL NE '05SAP' AND LD_STATUS EQ 'S'.
CASE CD_SEND_REC_REL.
WHEN '01SAP' OR '02SAP' OR '04SAP' OR '08SAP' OR '09SAP'.
CLEAR L_DYNNR.
L_DYNNR = '1220'.
WHEN '03SAP' OR '07SAP'.
CLEAR L_DYNNR.
L_DYNNR = '1230' .
WHEN '06SAP'.
CLEAR L_DYNNR.
L_DYNNR = '1210'.
WHEN '10SAP'.
CLEAR L_DYNNR.
L_DYNNR = '1270'.
ENDCASE.
PERFORM BDC_DYNPRO USING 'SAPLK23F1' L_DYNNR.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'COHEADER-SEND_REC_REL'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=PVAR'.
PERFORM BDC_FIELD USING 'COHEADER-SEND_REC_REL'
'05SAP'.
PERFORM BDC_FIELD USING 'RK23F-STATUS'
'S'.
PERFORM BDC_FIELD USING 'COHEADER-BLDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-BUDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-PERIO'
L_MONTH.
PERFORM BDC_FIELD USING 'RK23F-WAERS'
'EUR'.
PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
ELSEIF CD_SEND_REC_REL NE '05SAP' AND LD_STATUS EQ 'L'.
CASE CD_SEND_REC_REL.
WHEN '01SAP' OR '02SAP' OR '04SAP' OR '08SAP' OR '09SAP'.
CLEAR L_DYNNR.
L_DYNNR = '1220'.
WHEN '03SAP' OR '07SAP'.
CLEAR L_DYNNR.
L_DYNNR = '1230' .
WHEN '06SAP'.
CLEAR L_DYNNR.
L_DYNNR = '1210'.
WHEN '10SAP'.
CLEAR L_DYNNR.
L_DYNNR = '1270'.
ENDCASE.
PERFORM BDC_DYNPRO USING 'SAPLK23F1' '1200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'COHEADER-SEND_REC_REL'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=PVAR'.
PERFORM BDC_FIELD USING 'COHEADER-SEND_REC_REL'
'05SAP'.
PERFORM BDC_FIELD USING 'RK23F-STATUS'
'L'.
PERFORM BDC_FIELD USING 'COHEADER-BLDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-BUDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-PERIO'
L_MONTH.
PERFORM BDC_DYNPRO USING 'SAPLK23F1' '1200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RK23F-STATUS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=LISI'.
PERFORM BDC_FIELD USING 'COHEADER-SEND_REC_REL'
'05SAP'.
PERFORM BDC_FIELD USING 'RK23F-STATUS'
'S'.
PERFORM BDC_FIELD USING 'COHEADER-BLDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-BUDAT'
L_DATE2.
PERFORM BDC_FIELD USING 'COHEADER-PERIO'
L_MONTH.
PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
ENDIF.
CALL TRANSACTION 'KB11N' USING G_T_BDC MODE G_MODE MESSAGES
INTO G_T_MESSAGE.
IF NOT G_T_MESSAGE[] IS INITIAL.
READ TABLE G_T_MESSAGE WITH KEY MSGTYP = 'S'.
IF SY-SUBRC = 0.
DELETE FROM BALHDR WHERE LOGNUMBER = G_T_FINAL-LOGNUM AND
OBJECT = G_T_FINAL-OBJECT AND
SUBOBJECT = G_T_FINAL-SUBOBJECT.
COMMIT WORK.
G_T_TEMP = G_T_FINAL.
APPEND G_T_TEMP.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
CLEAR G_T_MESSAGE.
REFRESH G_T_MESSAGE.
*refresh g_t_bdc.
CLEAR G_T_BDC.
REFRESH G_T_BDC.
ENDIF.
ENDCASE.
ENDFORM. " USER_COMMAND
Vasanth -
How to generate an OUTBOUND INVOICE IDOC from the ABAP Program?
How to generate an OUTBOUND INVOICE IDOC from the ABAP Program? Any Function Module that can be used for this?
Hi
This is more of configuration
(1) Create a Output type with Medium 6 ( Check with your functional consultant)
(2) Maintain Partner Profiles using WE20 transaction
Idoc type - INVOIC02
Message type - INVOIC
Process Code - SD09
Regards
Madhan D -
Triggering smartform output from the report program
Hi,
I have developed a new report program.The selection screen of the report program is like this.
plant: ________
warehouse: ___________
sheet #: _________ to _________
bay/bin: ___________ to __________
building: ___________ to __________
counter sheet printer: __________
Auditor sheet printer: _________
When the data for sheet#,bay,building, counter sheet printer is given,then the counter sheet smartform has to be output on the screen.
or
When the data for sheet#,bay,building, auditor sheet printer is given,then the auditor sheet smartform has to be output on the screen.
Is it pessible to trigger the smartform from the selection screen of the report.If so can anyone send me a sample code for that.CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = <smartform name>
IMPORTING
fm_name = v_form_fm
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
Call Smartfrom to print the document
CALL FUNCTION v_form_fm
EXPORTING
p_compensation = p_comp <--parameter list
p_skill = p_skill
p_deci_auhtority = p_da
TABLES
s_job = s_job <--select option list
s_level = s_level
s_date = s_date
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
declare the paramters of your selection screen in the form interface section of the smartform.
If you have a parameter in teh selection screen then declare it in the smartform as:
P_matnr TYPE matnr (in form interface -
>import)
If you have a select option then
S_LEVEL LIKE <dictionary structure like a range>
this u declare it in the tables section of the form interface. For the select option , the dictionary sructures should be like a range (see RNGE_OBJID as an example). If you dont have a dictionary structure
then u need to declare it in the dictionary.
REWARD IF HELPFUL -
Trigerring Outbound XI interfaces in ABAP
Hi,
I need to know about calling an outbound XI interface in ABAP. Can any body share some knowledge about this?
Thanks,
KulwantKulwant,
>>>While i m trying to edit EXECUTE_ASYNCHRONOUS method of my class, it says "You Cannot Edit Proxy Objects". Is it the expected behaviour or some thing is wrong at my side
Yes. It is the expected behaviour. You can not edit a client(outbound) proxy. You need to have a report which will call this method and pass the reqd data.
P.S For server proxy, you can and need to edit the EXECUTE_ASYNCHRONOUS. Here you will write the code to retrive the data and process.
>>>In SXMB_MONI, i can see Sender Message but will there be any response message too? Because i cannot find such message
Since your interface is asynchronous, you will not have a respose msg.
Regards,
Jai Shankar. -
How to pass variable value into module pool scren from a report program
Hi,
I have created a report program with selection screen parameters. when the inputs are filled and executed it generates the purchase evaluation sequence number. i have created a screen and passed that number to display on it with print option and back option buttons as required. but variable alone is not getting passed from the program to module pool screen. buttons are working fine. value alone is not coming. can anyone please help me.
regards,
sudha.Hi ,
you need to declare that variable param at Global.
sample code...
report xyz....
data: g_no type ekko-ebeln.
start-of-selection...
g_no = '12345'.
call screen 0100. -
How to Pre fill the screen XD01/XD02, from the report program
Hello,
I have a requirment where i have to pass the screen values for the genral view of the tcode XD01/XD02,
For example : In my report program i get the Name, City, Country, PIN etc.. now my requirement is that the First Screen(Genral view) of the XD01 is pre filled with all the values that are passed from the Program and the user can continue after that.
Please suggest a way to achieve the mentioned functionality .
Regards,
AbhinavThanks
But the screen fields that i have to fill don't have parameter id's ..and i dont want to open the object by access key.
also my requirement is to leave to the transaction with the filled screen field .from the report prog...so when i use BDC i get the OK code , that i want to avoid. -
Create spool number from the report program
Hello,
I want to know the function module to create the spool request from report program, through which I can write the content of the internal table to spool.
Thanks,
LuckyHi Lucky ,
you will have to use 3 function modules in sucession to create a spool request as follows :
JOB_OPEN
JOB_SUBMIT
JOB_CLOSE
In case of any problem please get back to me.
Regards,
Nikhil -
Calling SQ00 from my report program
Hi,
My requirement is to place a radiobutton on the selection screen. when user selects this radio button and execute, he should be shown the selection screen of a query defined in SQ00. So I went to SQ00 and gave the query and executed. I was show a selection screen then I went to system > status and looked at the program name. It is AQL4Z_PURCHASELUMBERPOHT==. What is the ending '=='s? I think this program is auto generated. Can I use Submit with this report program? If I use this and if the selection screen is chaged then will this program name also changes? Please suggest me or any better way to achieve this requirement. Let me know if you need more information.
thank you,
surya.Hi Ferry,
I used it and giving me the same dump. Following is my code.
FORM open_query using l_wsid
l_bgrup
l_quold
changing l_reptname .
CALL FUNCTION 'RSAQ_REPORT_NAME'
EXPORTING
WORKSPACE = l_wsid
USERGROUP = l_bgrup
QUERY = l_quold
IMPORTING
REPORTNAME = l_reptname
CALL FUNCTION 'RSAQ_SUBMIT_QUERY_REPORT'
EXPORTING
QUERYREPORT = l_reptname
VARIANTE = ''
EXCEPTIONS
ONLY_WITH_VARIANT = 1
VARIANT_NOT_EXIST = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
submit (l_reptname). "ZFI_AGING_REPORT.
ENDFORM. -
How to get Header and footer in PDF file from a report program
I am generating spool from ALV GRID DISPLAY. Only the body of a report is coming in the SPOOL. I mean content of the TOP_UP_PAGE event is not coming in the SPOOL. Please suggest me.
Coding I am pasting here.
* Begin of modification(+) by I080845 ( Prasanta Maiti ) 12/23/2011 Defect# 17821
IF sy-batch IS NOT INITIAL
* Begin of modification(+) by I080845 ( Prasanta Maiti ) 01/19/2012 Defect# 18155
and i_final is NOT INITIAL.
* End of modification(+) by I080845 ( Prasanta Maiti ) 01/19/2012 Defect# 18155
* The print parameters are retrived and validate
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
* ARCHIVE_TEXT = c_check
* AR_OBJECT = c_check
* ARCHIVE_REPORT = c_check
* COVER_PAGE = c_check
in_archive_parameters = v_arcpar
in_parameters = v_pripar
destination = 'LOCL'
layout = 'X_65_512/2'"c_layout
line_count = '65' "60
line_size = '1024'
no_dialog = c_check
IMPORTING
out_archive_parameters = v_arcpar
out_parameters = v_pripar
valid = v_val
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF v_val NE space AND sy-subrc = 0.
v_pripar-prrel = space.
v_pripar-primm = space.
NEW-PAGE PRINT ON NEW-SECTION PARAMETERS v_pripar
ARCHIVE PARAMETERS v_arcpar NO DIALOG.
NEW-PAGE.
** displaying output in PDF
* PERFORM f_show_record.
* ALV Display
PERFORM f_alv_display.
NEW-PAGE PRINT OFF.
CALL FUNCTION 'ABAP4_COMMIT_WORK'.
ENDIF.
IF NOT sy-spono IS INITIAL.
"Declarations
v_spool_id = sy-spono.
* Checking the flag for too large spool
* IF v_too_large IS INITIAL.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = v_spool_id
no_dialog = space
IMPORTING
pdf_bytecount = v_bytecount
TABLES
pdf = i_pdf
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
Edited by: Thomas Zloch on Feb 10, 2012Hi,
Try with ALV LIST DISPLAY. I dont thing so its possible with ALV GRID DISPLAY. -
How to call LSMW from a Report program
Hi,
I have a requirment of extending vendor master data (Companycode data and Purchasing Organization data ) through Tcode XK02 using LSMW.Also I need to generate an error log file for validating the data from flat file and must have an export option of the error log file.
Can you help me how to proceed on this in steps.
Also pls let me know how to call LSMW transaction through a Report.
Based on the selection criteria I need to maintain two source structues,one for companycode data and the other for Purchasing Orgnization data for uploading data thru LSMW.How to do this?
pls respond ASAP,
Thanks,
NagendraHi,
create 2 LSMW object (under same project and subproject)..
one for extended vendor master data for company code data and other for extended purchase organization data for company code data.
Now check the radio buttons and based on that populate ur LSMW object.
Store project
project = < >.
Store subproject
subproj = < >.
Store object
object = '6GSC022_TS3'.
if r_ccode = 'X'.
Store object
object = < >.
else.
Store object
object = < >.
endif.
Call the function module to display object (LSMW) maintenance screen
CALL FUNCTION '/SAPDMC/LSM_OBJ_STARTER'
EXPORTING
project = project
subproj = subproj
object = object
EXCEPTIONS
no_such_object = 1
OTHERS = 2.
Generating error log:
After the checking the field if u think for this u need to generate error message then In the Maintain Field Mapping and Conversion Rules option under the required field write the following code:
data: v_msgtxt(100) type c.
message <msg ID> <message type> <message no>
with <var1> <var2>
into v_msgtxt.
write v_msgtxt.
Follow the next step in LSMW object till you reach the option Convert Data.
After you execute this option you will get the desired message here.
Regards,
Joy. -
Error while opening the EXCEL Sheet from a Report Program
Hi All,
I am getting an error saying 'SYLK: File Format is not valid' when my program is trying to open an excel sheet. I am using the function module WS_EXCEL to download it to excel sheet.
Following is the code:
Excel download
types: begin of t_excel,
c01(20),
c02(20),
c03(20),
c04(20),
c05(70),
c06(20),
c07(20),
c08(20),
c09(20),
c10(20),
end of t_excel.
data: a00_excel type standard table of t_excel.
concatenate 'C:\' sy-repid sy-uzeit 'FILE01' '.xls' into z_fname.
condense z_fname no-gaps.
call function 'WS_EXCEL'
exporting
filename = z_fname
tables
data = a00_excel
exceptions
others = 1.
if sy-subrc ne 0.
message e019(zsd).
Download to Excel failed.
endif.
a00_excel contains the data that is to be downloaded into the excel sheet. I used the same code in the other program it is working fine. If you see in the type declaration for C5 its 70 characters, i tried putting it as same as others to 20... still it doesnt work.
Thank You,
SureshNot sure man, your code works ok for me.
report zrich_0001.
types: begin of t_excel,
c01(20),
c02(20),
c03(20),
c04(20),
c05(70),
c06(20),
c07(20),
c08(20),
c09(20),
c10(20),
end of t_excel.
data: a00_excel type standard table of t_excel.
data: x00_excel like line of a00_excel.
data: z_fname type string.
x00_excel-c01 = 'A'.
x00_excel-c02 = 'B'.
x00_excel-c03 = 'C'.
x00_excel-c04 = 'D'.
x00_excel-c05 = 'E'.
x00_excel-c06 = 'F'.
x00_excel-c07 = 'G'.
x00_excel-c08 = 'H'.
x00_excel-c09 = 'I'.
x00_excel-c10 = 'J'.
append x00_excel to a00_excel.
x00_excel-c01 = 'K'.
x00_excel-c02 = 'L'.
x00_excel-c03 = 'M'.
x00_excel-c04 = 'N'.
x00_excel-c05 = 'O'.
x00_excel-c06 = 'P'.
x00_excel-c07 = 'Q'.
x00_excel-c08 = 'R'.
x00_excel-c09 = 'S'.
x00_excel-c10 = 'T'.
append x00_excel to a00_excel.
concatenate 'C:' sy-repid sy-uzeit 'FILE01' '.xls' into z_fname.
condense z_fname no-gaps.
call function 'WS_EXCEL'
exporting
filename = z_fname
tables
data = a00_excel
exceptions
others = 1.
if sy-subrc ne 0.
message e019(zsd).
* download to excel failed.
endif.
Regards,
Rich Heilman -
Sending email from a report program
Hi,
I have a requirement to update a ztable.
If the update statement fails then I need to populate all the messages into an internal table and use that internal table in the function module that is used to send the email with the error messages populated in the internal table.
How can I send the internal table populated with messages into the function module?hi,
refer this example, hope it will solve your issue.
DATA:
W_SUBJECT LIKE SODOCCHGI1, u201CFOR SUBJECT
I_PACK_LIST LIKE SOPCKLSTI1 OCCURS 1 WITH HEADER LINE, u201CFOR PACKING LIST
I_OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE, u201CFOR OBJECT HEADER
I_CONTENTS_TEXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE, u201CFOR MAIL CONTENTS
I_CONTENTS_BIN TYPE STANDARD TABLE OF SOLISTI1 WITH HEADER LINE,
u201CFOR ATTACHMENT
I_CONTENTS_HEX TYPE STANDARD TABLE OF SOLIX WITH HEADER LINE,
u201CFOR ATTACHMENT
I_RECEIVER LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE, u201CFOR RECIPIENTS
CONTENT_OUT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
In my example I have created a subroutine SEND_MAIL in which the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' is called for transferring the data in my internal table ITAB_INPUT as an excel file attachment, to an external email address.
FORM SEND_MAIL.
u201CSubroutine used for sending mail through the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'
DATA: TAB_LINES TYPE I, u201CFor Number of lines
SENT_TO_ALL LIKE SONV-FLAG,
OBJ_DESC LIKE W_SUBJECT-OBJ_DESCR, u201CObject description
LV_HEX1(1) TYPE C, "Carriage return
LV_LINES TYPE I. u201CNumber of record lines in the internal table
DATA: BEGIN OF LI_CONTENTS_BIN OCCURS 10, u201CLocal Structure to pass attachment contents
LINE TYPE STRING, u201Cin STRING form
END OF LI_CONTENTS_BIN.
DATA: BEGIN OF LI_CONTENTS OCCURS 10, u201CLocal Structure to pass attachment contents
LINE TYPE XSTRING, u201Cin XSTRING form
END OF LI_CONTENTS.
DATA: LI_CONTENTS_HEX TYPE STANDARD TABLE OF SOLIX WITH HEADER LINE.
u201CFor attachment
LV_HEX1 = CL_ABAP_CHAR_UTILITIES=>CR_LF. u201CLine carriage return
CLEAR: W_SUBJECT,
SENT_TO_ALL,
I_PACK_LIST[],
I_OBJHEAD[],
I_CONTENTS_HEX[],
I_CONTENTS_TEXT[],
I_RECEIVER[].
DESCRIBE TABLE ITAB_INPUT LINES LV_LINES. u201CCount number of lines in the internal table
*ADD ONE LINE FOR THE COLUMN HEADER
LV_LINES = LV_LINES + 1.
*Subject of the mail.
OBJ_DESC = 'TESTING TO SEND MAIL THROUGH ABAP'.
W_SUBJECT-OBJ_NAME = 'TEST MAIL '.
W_SUBJECT-OBJ_DESCR = OBJ_DESC.
*Creating the Body of the mail message
I_CONTENTS_TEXT = SPACE.
APPEND I_CONTENTS_TEXT.
CLEAR I_CONTENTS_TEXT.
MOVE 'DEAR SIR/MADAM,' TO I_CONTENTS_TEXT.
APPEND I_CONTENTS_TEXT.
CLEAR I_CONTENTS_TEXT.
*Adding a line feed in the mail contents
I_CONTENTS_TEXT = SPACE.
APPEND I_CONTENTS_TEXT.
CLEAR I_CONTENTS_TEXT.
CONCATENATE
u2018THIS IS A TEST MAIL TO CHECK IF DATA FROM AN INTERNAL MAIL IS SENT TO AN EXTERNAL ADDRESS AS AN EXCELu2019 'FILE.' INTO I_CONTENTS_TEXT.
APPEND I_CONTENTS_TEXT.
CLEAR I_CONTENTS_TEXT.
I_CONTENTS_TEXT = SPACE.
APPEND I_CONTENTS_TEXT.
CLEAR I_CONTENTS_TEXT.
I_CONTENTS_TEXT = 'WARM REGARDS'.
APPEND I_CONTENTS_TEXT.
CLEAR I_CONTENTS_TEXT.
I_CONTENTS_TEXT = SPACE.
APPEND I_CONTENTS_TEXT.
CLEAR I_CONTENTS_TEXT.
*Creating the body of the attachment file of the mail
*Creating the column headers for the Status report
*the separation of # is used to divide the data into diff columns.
CONCATENATE 'USER NAME'
'TIME'
'SHORT TEXT'
'LONG TEXT'
u2018DATE'
'MESSAGE'
INTO LI_CONTENTS_BIN-LINE SEPARATED BY LC_TAB.
u201CLC_TAB is used to insert a # (HASH) delimiter
u201CBetween the columns
CONCATENATE LI_CONTENTS_BIN-LINE LV_HEX1 INTO LI_CONTENTS_BIN-LINE.
APPEND LI_CONTENTS_BIN.
CLEAR LI_CONTENTS_BIN.
*loop into internal table ITAB_INPUT and fill the table for attachment
LOOP AT ITAB_INPUT.
CONCATENATE
ITAB_INPUT-UNAME
ITAB_INPUT-TIME
ITAB_INPUT-SHORT_TEXT
ITAB_INPUT-LONG_TEXT
ITAB_INPUT-DAT
ITAB_INPUT-MESSAGE
INTO LI_CONTENTS_BIN-LINE SEPARATED BY LC_TAB.
*ADD THE CARRIAGE RETURN TO THE LAST RECORD.
IF LV_LINES GT SY-TABIX.
CONCATENATE LI_CONTENTS_BIN-LINE LV_HEX1 INTO LI_CONTENTS_BIN-LINE.
ENDIF.
APPEND LI_CONTENTS_BIN.
CLEAR LI_CONTENTS_BIN.
ENDLOOP.
TO COMPRESS THE CONTENTS u2013 THE CONVERSION APPLIED IS STRING TO XSTRING AND THEN XSTRING TO BINARY.BINARY DATA WAS PASSED INTO I_CONTENTS_HEX----
THIS CONVERSION WAS REQUIRED BECAUSE IN MY EXAMPLE I M USING THE CONTENTS_HEX PARAMETER TO PASS THE ATTACHMENT>
*Converting the table contents for attachment from STRING to XSTRING and then XSTRING to BINARY
*For this purpose the following function modules 'SCMS_STRING_TO_XSTRING' and 'SCMS_XSTRING_TO_BINARY' are used.
LOOP AT LI_CONTENTS_BIN.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
TEXT = LI_CONTENTS_BIN-LINE
MIMETYPE = ' u2018
ENCODING =
IMPORTING
BUFFER = LI_CONTENTS-LINE
EXCEPTIONS
FAILED = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
BUFFER = LI_CONTENTS-LINE
APPEND_TO_TABLE = 'I_CONTENTS_HEX'
IMPORTING
OUTPUT_LENGTH =
TABLES
BINARY_TAB = LI_CONTENTS_HEX
LOOP AT LI_CONTENTS_HEX.
APPEND LI_CONTENTS_HEX TO I_CONTENTS_HEX .
ENDLOOP.
ENDLOOP.
*Write Packing List (Body)
*Describe the body of the message -
the various fields of the Packing List have already been explained above
CLEAR I_PACK_LIST.
I_PACK_LIST-TRANSF_BIN = SPACE.
I_PACK_LIST-HEAD_START = 1.
I_PACK_LIST-HEAD_NUM = 0.
I_PACK_LIST-BODY_START = 1.
DESCRIBE TABLE I_CONTENTS_TEXT LINES I_PACK_LIST-BODY_NUM.
I_PACK_LIST-OBJ_DESCR = 'STATUS REPORT'.
I_PACK_LIST-DOC_TYPE = 'RAW'.
APPEND I_PACK_LIST.
CLEAR I_PACK_LIST.
*Describe the attributes of the attachment of the mail
DESCRIBE TABLE I_CONTENTS_HEX LINES TAB_LINES.
READ TABLE I_CONTENTS_HEX INDEX TAB_LINES.
W_SUBJECT-DOC_SIZE = TAB_LINES * 255 + STRLEN( I_CONTENTS_BIN ) .
I_PACK_LIST-TRANSF_BIN = 'X'.
I_PACK_LIST-HEAD_START = 1.
I_PACK_LIST-HEAD_NUM = 1.
I_PACK_LIST-BODY_START = 1.
I_PACK_LIST-BODY_NUM = TAB_LINES.
I_PACK_LIST-DOC_TYPE = 'XLS'.
I_PACK_LIST-OBJ_DESCR = 'STATUS REPORT'.
APPEND I_PACK_LIST.
CLEAR I_PACK_LIST.
*Create receiver list from selection parameter
*In my example, I have created a selection parameter for obtaining the recipientsu2019 address from the user. *The selection screen values for S_RCPNT is then passed onto to the parameter for the recipient.
LOOP AT S_RCPNT.
I_RECEIVER-RECEIVER = S_RCPNT-LOW.
I_RECEIVER-REC_TYPE = 'U'.
APPEND I_RECEIVER.
CLEAR I_RECEIVER.
ENDLOOP.
Function Module called for sending the mail to the intended recipients
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_subject
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = sent_to_all
NEW_OBJECT_ID =
TABLES
packing_list = i_pack_list
object_header = i_objhead
contents_hex = i_contents_hex
contents_txt = i_contents_text
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
receivers = i_receiver
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM SEND_MAIL.
Thanks and Regards,
Ahamed.
Maybe you are looking for
-
How do I connect dual link dvi to hdmi so I can use my TV as a monitor?
I have tried to google this for some time and have gotten nothing but conflicting responses. I have a 15" macbook pro with a dual link dvi port. I want to connect it to the hdmi port on my HDTV. What do I need to make that happen? Is there actuall
-
Unable to filter the data for multiple time selections by dimensions
Hi to all, I am new in MDX, i have a problem with my MDX query. Calculated Member Logic: SUM((OPENINGPERIOD([Date].[YQMD].[Year],[Date].[YQMD].[Month].&[2010-12-01T00:00:00]):[Date].[YQMD].Currentmember),[Measures].[Paid Amt]) Mdx Logic EX: With Memb
-
Keywords imported from PSE 5.0 (Poor User Experience)
When moving to Lightroom, I successfully imported my substantial catalog (6,000 images) from Photoshop Elements 5.0. Keyword importing doesn't seem to be quite right, however. I've noticed the following two problems. 1. All keywords appear both in th
-
Need Help with Oracleasm - a kernel module for the ASM library
I am a beginner, trying to install Oracle RAC. I have a system with SuSE Linx 11 (64 bit) loaded. I need to get the correct ASMLib packages needed for installing ASM. I think I got the following packages that are needed for installing ASM 1) oracleas
-
RE: iBook Network Connection Query
Hi I wonder if anyone can help me here. I have a Power Mac G5 which is linked to a wireless router (D-Link Dl-524 802.11g Wireless Broadband Router) by ethernet. My iBook G4 until today connected fine wirelessly, as did ATV and its all been running p