Reg output in Function module
Under Function Module
Exporting parameter
*" EXPORTING
*" VALUE(Y_HIGHEST_MSGTYPE) LIKE TE950-DISPLAY_MOVEIN
Here I want to do Error out one Message based on condition.
I Written condition, but how should I incorporate error as output in exporting parameter .
This T9950-DISPlay_movein having following parameters
fields
MSGNR(3)
BPWMODE(1)
DISPLAY_BPE(1)
DISPLAY_BPA(1)
DISPLAY_BPI(1)
Thanks,
Sonar
Hi Sonar,
I hope you are referring to a custom FM. If it is standard, please mention the name and people would be able to provide the details.
To get the error messages, you can create and Error Internal Table and pass it to your Tables parameter. Later on read this table and show your messages.
If you have issues, please elaborate a little more, cut paste some code and it will easier to analyze.
Similar Messages
-
Printing ALV Report output through Function Modules
Hi All,
I want to print my ALV Grid output through function modules/statement (not through print option in menu).
This is because, i am generating a PDF from spool when user clicks on a button. If any changes happened in the ALV output layout, they will be captured in spool through printing it.
So can you please tell me how to print the ALV Output through FMs or sending the ALV output to spool.
Thanks & Regards,
Senthil.
Edited by: senthil nathan on May 17, 2010 2:49 PMHi Dev,
Thanks for the reply.
I want to print the ALV when the user clicks on a button in toolbar. Lets say the user has made some changes to the layout, (E.g hiding a field) and when i print that output it should use the changed layout, If i use the FM suggested by you, i cant acheive this.
If you try to print this manually, the system uses the changed layout and not the original. Thats why i want to know FMs/statement to print.
Regards,
Senthil. -
Dynamic table as output in Function Module
Hi all,
I am trying to output a dynamic table from a FM. I am a generating a dynamic internal table in the FM. Now i want to assign that internal table to a table parameter of the FM so that i can use that table in the calling program. can this be done?
regards,
hamzaYou may need to look into code of sap function module
RFC_READ_TABLE
a® -
Transfer ALV Output through Function Module
Hi All,
I have a requirement where I am dealing with two systems.
1) There is a report program which run in ECC Server and it makes an RFC Call to trigger another program in APO Server
2) The target program generates an ALV Output and I just want to bring back the output into ECC system
3) How to achieve this ? How can transport the AVL Output throug the parameters of the RFC Function Module.
Any help/clue on this would be highly appreciated
Thanks,
Babu KilariHello Babu,
If you are submitting the standard report in background mode, try this algo:
1. You can export the output list to the ABAP memory using the EXPORTING LIST TO MEMORY.
2. Then get the list details using the FM: LIST_FROM_MEMORY. Return the resultant internal table to your RFC.
Hope this helps.
BR,
Suhas -
Reg : IDOC - inbound function module
HI guys,
I have an ....list of error inbound idocs .......(presently using function module X)......
but recently we made lot of changes in inbound function module and release as "Y"...hence presently all idocs Uses the inbound function module 'Y'.
In this scenario i wanted to re-process the old idocs.....(which were in error state 51).......Which should use the old function module 'X'.....(it should not use Function module 'Y')
In short 'based on the date ....my inbound function module should be assigned while processing idocs.
idoc date < 01.01.2011 then old function module (I.E FM "X")
idoc date > = 01.01.2011 then new function module (i.e. FM "Y")
regards
GirishYou can't do that via the standard config. You can, however, embed the call to your 'X' function in your new 'Y' function based on your date criteria. Whether that date is hard-coded or stored in TVARVC is up to you.
-
Generete output using function modules.
Hi,
can any one help me in this...
SELECT SINGLE changenr FROM cdpos INTO iv_changenr WHERE objectclas = 'EINKBELEG' AND
objectid = wa_ekpo-ebeln AND tabname = 'EKPO' AND tabkey = iv_tabkey AND fname = 'KEY' AND
chngind = 'I'.
IF sy-subrc = 0.
SELECT SINGLE udate FROM cdhdr INTO iv_udate WHERE objectclas = 'EINKBELEG'
AND objectid = wa_ekpo-ebeln AND changenr = iv_changenr.
I want togenerete the above code using this FMs....
CHANGEDOCUMENT_READ_HEADERS' ..and...CHANGEDOCUMENT_READ_POSITIONS'.
Help me in this..
Thanks,
PKHi,
Refer below sample code.
DATA: LS_CDRED LIKE LINE OF GT_CDRED.
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
ARCHIVE_HANDLE = 0
DATE_OF_CHANGE = '00000000'
OBJECTCLASS = 'YTEST_TABLE_CNG'
OBJECTID = ' '
TIME_OF_CHANGE = '000000'
USERNAME = SY-UNAME
LOCAL_TIME = ' '
DATE_UNTIL = '99991231'
TIME_UNTIL = '235959'
NOPLUS_ASWILDCARD_INOBJID = ' '
TABLES
I_CDHDR = GT_CDHDR
EXCEPTIONS
NO_POSITION_FOUND = 1
WRONG_ACCESS_TO_ARCHIVE = 2
TIME_ZONE_CONVERSION_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE 'No entries found' TYPE 'E'.
ENDIF.
IF NOT GT_CDHDR IS INITIAL.
LOOP AT GT_CDHDR INTO GS_CDHDR.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING
CHANGENUMBER = GS_CDHDR-CHANGENR
TABLES
EDITPOS = GT_CDSHW
EDITPOS_WITH_HEADER = GT_CDRED
EXCEPTIONS
NO_POSITION_FOUND = 1
WRONG_ACCESS_TO_ARCHIVE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE 'No item details found' TYPE 'E'.
ELSE.
LOOP AT GT_CDRED INTO LS_CDRED.
MOVE-CORRESPONDING GS_CDHDR TO GS_OUT.
MOVE-CORRESPONDING LS_CDRED TO GS_OUT.
APPEND GS_OUT TO GT_OUT.
CLEAR: GS_OUT,
LS_CDRED.
ENDLOOP.
CLEAR: GS_CDHDR.
ENDIF.
ENDLOOP.
ENDIF.
Thanks,
Archana -
Reg: Use of Function Module 'BAPI_PRDSRVAPS_SAVEMULTI2'
Hi,
I am using the above BAPI to create Warehouse product, but I am not finding the follwing fields in its structures, Just let me know whether I am using the correct BAPI,my requirement is to convert EWM material master in SCM system, and also help me out to find the follwoing fields.
LGNUM Warehouse no
VASVCP Consumption-Relevant for VAS
LASTSLOT Time of Last Slotting Run
BACKFLUSH_PROD Indicator for Backflush Withdrawal for Product
KIT_FIXED_QUAN Type of Quantity Correlation for Kits
Thanks
RKSD_SALES_SCHEDULE_MAINTAIN is for Change availability check / schedule lines in sales orders.
Example:
LOOP AT xvbep.
CLEAR : lt_header_x , lt_return , lt_return[] ,
schedules_in , schedules_in[] ,
schedules_inx, schedules_inx[] .
lt_header_x-updateflag = 'U'.
schedules_in-itm_number = xvbep-posnr.
schedules_in-sched_line = xvbep-etenr.
schedules_in-REQ_DLV_BL = '20'.
APPEND schedules_in.
schedules_inx-itm_number = xvbep-posnr.
schedules_inx-sched_line = xvbep-etenr.
schedules_inx-updateflag = 'U'.
schedules_inx-REQ_DLV_BL = 'X'.
APPEND schedules_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = xvbep-vbeln
order_header_inx = lt_header_x
TABLES
schedule_lines = schedules_in
schedule_linesx = schedules_inx
return = lt_return.
APPEND LINES OF lt_return TO gt_return.
LOOP AT lt_return WHERE type EQ 'E'
OR type EQ 'A'.
EXIT.
ENDLOOP.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
endloop.
regards,
srinivas -
Reset PO Output Via Function Modules
Hi,
We are changing the PO after it is released and outputted, We are using the BAPI_PO_RESET_RELEASE to reset the PO to release and this fails because the PO is already outputted and entry exist in NACE, So is there any FM to revert back the NACE to original or logic to revert it back or Shall I simply modify the table NAST.. Experts advice required..
regards,
PrabhuDid you ever find a solution to this?
-
Empty table output of function module
Hi experts!!
I have created a F.M. where i have stated an internal table as "Tables"
I run my F.M. & what i get is itab: 0 entries
result: 256 (e.g.) entries.
What am i doing wrong???very less input.. either code needed or need on which field or which area you wrote ur FM
-
Hi
I am displaying output in function module using 8 tables. But here i am writing code using for all entries.
But the problem is what are the fields specify in the select query those fields are displaying in the output. But i want only particular fields.
Here is there any possibility to write WRITE statement?I think you may need to re-state the question a bit as it is not clear -
I am displaying output in function module using 8 tables. -> Are you displaying the data onto a screen or a list or just returning the results in the FM parameters?
But here i am writing code using for all entries. -> Why does this have an impact on the problem?
But the problem is what are the fields specify in the select query those fields are displaying in the output. But i want only particular fields. The fields you include in your select do not have to appear in any output e.g. you could select all and display one
select * from t001.
write: / t001-bukrs. "output one field from many...
endselect.
Here is there any possibility to write WRITE statement? You can have "write" statements in a function module but you need a screen "canvas" to display them on, so how / whether you see them will depend on where the code is invoked from and what's in the code.
Jonathan -
Hi,
report create for Sale order activity.this report using for mvt type based . i am using for mseg table.
data all used for select query. but slow the process. i have effected the report output. any function module or BAPI using.
plz,Advise Me.
by,
jeevan.Hi Jeevan,
Try to use BAPI_GOODSMVT_GETITEMS BAPI Function module.
Cheers,
Daniel -
Call an ABAP program or a function module from command prompt/python script
Dear All,
I want to call a function module/ABAP program from command prompt or a python script.
Let me explain with an example.
There is a function module "z_add" that takes two integers as input parameters and generates their sum.
the sum is the output parameter.
Now i want to call this function module from command prompt / python script and pass parameters to this function module.
In return i must get the sum(i.e. the output of function module).
I tried using STARTRFC ,was able to call the FM but could not get the return value(output) from FM.
Can you please provide me the code of such a function module and the method to call it thereby passing parameters and getting the sum.
Thanks and regards,
Gaurav
Edited by: gauravkec2005 on Mar 4, 2010 7:41 AMthank you both! helpful answers! :o)
anyway!
i have written the program which is called from the SAPScript:
/: PERFORM GET_VATNUMBER IN PROGRAM ZFI_F140_OPERATIONS
/: USING &BKPF-BUKRS&
/: CHANGING &VATNUMBER&
CE VAT Registration No : &VATNUMBER&
REPORT zfi_f140_operations.
FORM get_vatnumber TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
DATA: lv_co_code TYPE bukrs,
lv_vat_no TYPE stceg.
READ TABLE in_par WITH KEY name = 'BKPF-BUKRS'.
MOVE in_par-value TO lv_co_code.
SELECT SINGLE stceg FROM t001
INTO lv_vat_no WHERE bukrs = lv_co_code.
out_par-name = 'VATNUMBER'.
WRITE lv_vat_no TO out_par-value.
CONDENSE out_par-value.
MODIFY out_par INDEX 1.
ENDFORM.
it is not working and i cannot work out why...
i have not been ABAPing for very long but have had a go....
any thoughts as to what i have done wrong?
or point me where i should be looking? thank you! -
FUNCTION MODULE CREATION FOR GENERIC DATA SOURCE
Hi BI gurus,
I am creating function module for generic datasource. For that I followed below mentioned steps
Steps
1. Created s structure with the fields that needed.
2. Created FM by copying the standard Function module
" RSAX_BIW_GET_DATA_SIMPLE " and Give a New name starting With
Y or Z .
3. IN SE37 ->Your Function module name -> Change, In table tab given structure
name by deleting the associated type given in E_T_DATA .
And inserted the required code given below
PROGRAM 'ZHU_BALANCE'.
*& Report ZHU_BALANCE
TABLES: VEKP, VEPO.
DATA: BEGIN OF T_DISPLAY,
DATE LIKE SY-DATUM,
EXIDV LIKE VEKP-EXIDV,
LGORT LIKE VEPO-LGORT,
WERKS LIKE VEKP-WERKS,
END OF T_DISPLAY.
DATA: ITAB_DISPLAY LIKE TABLE OF T_DISPLAY.
DATA: WA_ITAB_DISPLAY LIKE LINE OF ITAB_DISPLAY.
SELECT VEKPEXIDV VEPOLGORT VEPO~WERKS
INTO CORRESPONDING FIELDS OF TABLE ITAB_DISPLAY
FROM VEKP AS VEKP INNER JOIN VEPO AS VEPO
ON VEKPVENUM = VEPOVENUM
AND VEKPWERKS = VEPOWERKS
WHERE VEKP~VSTEL = SPACE
AND VEKP~VEGR1 = '401'
AND VEKP~VPOBJ = '12'
AND VEKP~STATUS = '0020'
AND VEPO~VEPOS = '000001'.
LOOP AT ITAB_DISPLAY INTO WA_ITAB_DISPLAY.
WA_ITAB_DISPLAY-DATE = SY-DATUM.
MODIFY ITAB_DISPLAY FROM WA_ITAB_DISPLAY TRANSPORTING DATE.
ENDLOOP.
WRITE:/ 'DATE', 20 'EXIDV', 40 'LGORT', 60 'WERKS'.
ULINE.
LOOP AT ITAB_DISPLAY INTO WA_ITAB_DISPLAY.
WRITE:/ WA_ITAB_DISPLAY-DATE, 20 WA_ITAB_DISPLAY-EXIDV , 40 WA_ITAB_DISPLAY-LGORT, 60 WA_ITAB_DISPLAY-WERKS.
ENDLOOP.
While checking the function module its populating the syntax error as
THE TYPE SRSC_S_IF_SIMPLE IS UNKOWN. (Though this is commented in program)
So pls suggest
Regards,
prafulhi indira,
thanx for ur reply we have created the funcion module successfuly it is also showing the output correct. But when we put that function module in the generic data source and try to extract data in RSA3 it shows the correct output of function module but with the msg ' 0 entries found in customer enhancement' and therfore zero records in the display list.
is there any correction or steps to be followed in data extraction
pls suggest
regards,
praful -
Hello Friends,
i have created one Zfunction module in tht i have written code for interactive alv with check boxes.
now when the user selects the checkboxes amd press save button in alv grid display the output gets saved in one internal table in the source code itself but how to show the same output in the output of function module.
i declared the same structure type table in tables parameter of function module but m not getting any output .
pls suggest ....
Regards,
Sunny
Please use a more informative subject
Edited by: Rob Burbank on Feb 24, 2009 11:19 AMHi Sunny,
Please ignore my previous post.
I have partially understood your question. I assume that you have the required data in an internal table.
1. If you want it to be displayed in the output (in an internal table), then you can use the statement
itab2[] = itab1[].
where itab1[] is the internal table where you have all the data to be displayed (the one your specified),
itab2[] is the internal table declared in the "TABLES" tab of the function module.
Note: Here itab1 and itab2 should be of same structure.
2. If you want it to be displayed in an ALV format, then you can use the standard function module 'REUSE_ALV_GRID_DISPLAY' -
Problem in Functional Module on BW Query
Hi,
We are working on below requirement in BW.
We have to fetch the data of BW Query via a functional module to web services. We have created a query and a functional module based on that query. To create the function module on query, we have followed the standard method suggested in SAP blog. (ie. Input parameters for Functional Module is Filters use in Query and output parameters will be Keyfigures and Char. Of the Query).
We have 0PLANT in the raw section in query. We want to fetch plant text in the Function module output. But, our problem is we are getting Plant KEY value only in the output of functional module.
0PLANT properties in query designer is set to TEXT only.
So, in short, we want to have 0PLANT Text in the function module output.
Please suggest.
Regards,
Macwan James.Hi,
In your Function module, I hope the code is perfect. Please check your Infoobject maintenance whether text was maintained.
Regards,
Suman
Maybe you are looking for
-
Can you view a whole year in iCal, rather than just day, week, month?
Does anyone know if there is a plug in or something (alternative app. even) that allows you to view the whole YEAR rather than just a month at a time? I want something that will function almost like a wall planner.
-
How to remove the '#'symbols for infoobject movement types in bex reporting
Hi All, I have a problem in Bex reporting. The problem is when ever executing the report that time some of the characteristic values is shown in layout '#' Symbols. i want to remove the '#' valuse in report. is it possible please give me step by s
-
I am in Japan. My iTunes is a US account. I need to add an app to my Japan based iPhone. It is not available in US iTunes. Do I need another iTunes account in Japan?
-
Employee vs. Vendor report
Hi All, I have a list of employees and I need to check if all of them has assigned Vendor. Is there any report for these purposes or any other way to resolve this issue? Thanks in advance, Denis
-
I keep receiving a trust certificate error about imap.aol server. Says it may be the result of an imposter or the "real" aol imap server? How do you determine if the trust certificate is for an imposter?