GoalSeek Function in ABAP
Hi,...
Is there any function in ABAP similar to GoalSeek function in Excel?
thanks
well, Actually I have a math calculation say:
net + tax = gross (this is for example only, the real one should be more complex than this)
with this formula I can have gross value ... but what if I have gross value ... how is the net if I have tax?
with excel GoalSeek function, I easyly can do that....
I wonder is there any similar function or command or whatever in abap/sap? or I can only do that by creating 2 sub procedures, one for net + tax = gross, second for gross - tax = net?
thanks
Similar Messages
-
Approximate operator and recursive call function in abap
Dear expert,
Please give me an example about Approximate operator and recursive call function in abap
thanks so muchHi
About Approximate operator, you can go to tcode 'ABAPDOCU', searching CO,CN,CA etc...each of them have example there.
And recursive function,
Say here is a FM,
FUNCTION recursive_get_number.
*import im_num type i.
*export ex_num type i.
ex_num = im_num + 1.
IF ex_num GE 100.
EXIT.
ELSE.
CALL FUNCTION recursive_get_number
EXPORTING
im_num = ex_num
IMPORTING
ex_num = ex_num.
ENDIF.
ENDFUNCTION.
When you call this function from outside with importing parameter '1', then will return you 100.
regards,
Archer. -
How to use RTRIM function in ABAP
Hey,
I have a question on using trim function in ABAP. According to all documents, I should be able to use rtrim as
shorttext = rtrim('abcde-xx', '-xx').
But when I do that, it gives me an error message "Comma without preceding colon (after shorttest?)"
Anyone can tell me why is this happening? how should I use this trim function? And for me to cut off variable's last few character, what else method can I use?
Thank you very much.DATA : T1 TYPE STRING VALUE 'abcde-xx',
T2 TYPE STRING VALUE '-xx'.
REPLACE T2 INTO T1 WITH SPACE.
WRITE :/, T1.
result output is : 'abcde'.
regards
Guna -
IP - Is it possible to call exit planning function from ABAP Report..
Hi All,
Greetings.
Is it possible to call exit planning function from ABAP Report (t-code SE38) ? Or I mean is not limited only to be called from ABAP Report, perhaps from BSP / Web-Dynpro / Function Module.
If somebody here has been doing it before, I'm keen to ask to kindly share it. Particularly how to call and transfer data to that exit function.
Or if somebody has done in BPS, appreciate if it can be shared too .
Thanks a lot and have a good day,
Best regards,
Daniel N.Hi.
You can achive this as suggested by Mattias in your previous post.
Lets say you have next data structure:
CostCenter | Amount | PercentForDistibution |
Create input ready query in this format. Restrict cost center by variable type range.
Create WAD with analysis item.
When you run web page you enter range of cost centers (lets say you will enter 101004 to 101010).
I assume you have data only for 101004 in your cube (lets say 1000).
You will see only one record in your webpage.
CostCenter | Amount | PercentForDistibution |
101004 | 1000 | NOTHING
When you create WAD in analysis item properties set "NUMBER_OF_NEW_LINES" to lets say 1 (so in WAD you will see always one blank line for entering new data).
Just add 6 new records:
CostCenter | Amount | PercentForDistibution |
101005 | NOTHING| 10
101006 | NOTHING| 30
101007 | NOTHING| 20
101008 | NOTHING| 25
101009 | NOTHING| 5
101010 | NOTHING| 10
Then run planning FOX function like this:
FOREACH Z_COST_CENTER.
IF {Amount, Z_COST_CENTER} <> 0
Z_AMNT_TO_DISTRIBUTE = {Amount, Z_COST_CENTER}.
ENDIF.
ENDFOR.
FOREACH Z_COST_CENTER.
IF {PercentForDistibution Z_COST_CENTER} <> 0.
{Amount, Z_COST_CENTER} = Z_AMNT_TO_DISTRIBUTE * {PercentForDistibution Z_COST_CENTER}.
ENDIF.
ENDFOR.
It is not perfect FOX, but as an idead, it should work.
Regards. -
JCo Outbound( calling Java Function from ABAP )
HI,
I want to call a JAVA function from ABAP.I have installed the JCo toolkit and included the sapjco.jar file in the classpath of my system.
When i execute the program(Example5.java,provided with sapjco.zip) from the command prompt,it is working fine,the server listens to the calls made from ABAP via RFC destination.
But if i copy the same program in NWDS in a JAVA project,to run it from there as JAVA application,after including the sapjco.jar file in the project JAVA build path,i get the following error,marked by a red cross ,at the head of the program,even before i run it.
<b>This compilation unit indirectly references the missing type com.sap.jdsr.writer.DsrIPassport (typically some required class file is referencing a type outside the classpath)</b>
What changes do i need to make,to run it from NWDS?
I tried to include the sapjcorfc.dll file along with the sapjco.jar in the java build path,but it doesn't help.
Please tell how to solve this issue?
Regards,
Siddharthahello sid,
which jco version are you using?
are you using the same jco lib when running in command
line and in nwds?
if you are, try checking the order of the your classpath.
your jco lib (which you are using in command line) should
come first in order prior to the default libraries in your project.
regards
jo -
Need a File Parameter with Browse Functionality in ABAP
Hi
I Need a File Parameter with Browse Functionality in ABAP.
Can anyone help me with logic.
Regards,
SreeCheck below code:
PARAMETERS: p_file TYPE localfile.
DATA: l_path TYPE string,
l_fpath TYPE string,
l_fname TYPE string.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = 'Save to...'
default_extension = '.txt'
initial_directory = 'C:\'
CHANGING
filename = l_fname
path = l_path
fullpath = l_fpath
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc EQ 0.
MOVE l_fpath TO p_file.
ENDIF. -
Hi,
Is there a way to debug a C function in ABAP.
How can I view it's source code from the system ?
BR,
Rotem.Hi,
These functions are for internal use by SAP - therefore there is no
documentation.
It is not recommended that they are used (unless absolutely no other
option exists) since SAP don't support them for customer use.
Regards
Hiren K.Chitalia -
Call a Java Function From Abap
Hi, I need to call a java function from ABAP, I have a WAS 640 to deploy the module.
I have found this tutorial...
[ABAP calls Java via RFC|/people/thorsten.franz3/blog/2008/11/21/abap-calls-java-via-rfc-1-introduction]
The problem is that it uses a newer version of WAS and it implements EJB 3.0 wich only works on Java 5, but my WAS has java 1.4.2.
Anyone knows how to adapt this Blog to a WAS 640 version ?
Or Perhaps there is another way of doing this, maybe publishing my function as a web service.
Regards.
Mariano.Why don't you expose your Java functionality as a Web Service and consume it in ABAP program. That should be much easier and the web service can be used in other places as well.
Best regards,
Ritesh Chopra -
Can someone please let me know the diffrence between functional and ABAP specifications and what exactly we doing while writing these kinds of specs.
What are the kind of specifications does a functional person and what is that a ABAP person do?
Can a functional person write ABAP specifications?Hi Saleema,
Functional Specifications are prepared by functional consultant basically if the standard sap is not suited for the clients business process.
Then on the basis of the functional specifications the ABAPER will develop the logic by user exit or bapi etc.
So, a ABAPER can prepare a technical specification only on the basis of the functional specification.
Generally in the functional specification u will write the current process happening and expected process, how the program has to work and what will be the output will be specified.
I hope u understood.
regards
srikanth. -
Hi Experts,
The following is the ABAP Code used in Function Module to extract Master Data from R/3 to BW.Could please convert that into human language (Explain logic of code)
FUNCTION MDEX_MATERIAL_MD .
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SBIWA_S_INTERFACE-REQUNR OPTIONAL
*" VALUE(I_CHABASNM) TYPE SBIWA_S_INTERFACE-CHABASNM OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SBIWA_S_INTERFACE-INITFLAG OPTIONAL
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE OPTIONAL
*" VALUE(I_DATAPAKID) TYPE SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
*" VALUE(I_S_TIMEINT) TYPE SBIWA_S_TIMEINT OPTIONAL
*" VALUE(I_RLOGSYS) TYPE SRSC_S_INTERFACE-RLOGSYS OPTIONAL
*" VALUE(I_PRIVATE_MODE) OPTIONAL
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SBIWA_T_FIELDS OPTIONAL
*" E_T_BIW_MARA_S STRUCTURE BIW_MARA_S OPTIONAL
*" E_T_BIW_MARC_S STRUCTURE BIW_MARC_S OPTIONAL
*" E_T_BIW_MARD_S STRUCTURE BIW_MARD_S OPTIONAL
*" E_T_BIW_MVKE_S STRUCTURE BIW_MVKE_S OPTIONAL
*" E_T_BIW_MARM_S STRUCTURE BIW_MARM_S OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
function acts as a S-API-compatible interface for the SD-extractor
MATERIAL_DYNAM_DATA_SELECTION
STATICS: L_FIRST_CALL TYPE SBIWA_FLAG,
L_NO_SELECT TYPE C.
DATA: L_SUBRC TYPE SBIWM_SUBRC.
DATA: L_T_CHABASCMP LIKE RSSOSFIELD OCCURS 0 WITH HEADER LINE,
L_S_REQUEST TYPE RSAP_S_REQUEST,
L_SLOGSYS LIKE TBDLS-LOGSYS,
L_RODCHABGEN LIKE RODCHABGEN,
L_LINES TYPE I,
L_TX_SELECT TYPE SBIWA_TX_SELECT,
L_T_SELECT TYPE SBIWA_T_SELECT,
L_S_SELECT TYPE SBIWA_S_SELECT.
DATA: L_T_MARA LIKE MARA OCCURS 10 WITH HEADER LINE,
L_T_MARC LIKE MARC OCCURS 10 WITH HEADER LINE,
L_T_MARD LIKE MARD OCCURS 10 WITH HEADER LINE,
L_T_MVKE LIKE MVKE OCCURS 10 WITH HEADER LINE,
L_T_MARM LIKE MARM OCCURS 10 WITH HEADER LINE.
DATA: L_S_MATNR_MATERIAL_KEYS LIKE PRE03,
L_S_WERKS_MATERIAL_KEYS LIKE PRE01,
L_S_LGORT_MATERIAL_KEYS LIKE PRE08,
L_S_VTLIN_MATERIAL_KEYS LIKE PRE10.
Variable to read compound information "note383430 insED08052001
DATA: i_chabasnm_cmp TYPE sbiwa_s_interface-chabasnm.
"note383430 insED08052001
IF I_INITFLAG = 'X'.
Initialization: check input parameters
buffer input parameters
prepare data selection
Invalid second initialization call -> error exit
IF NOT G_FLAG_INTERFACE_INITIALIZED IS INITIAL.
IF 1 = 2. MESSAGE E008(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'008' "message number
' ' "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ELSE.
G_FLAG_INTERFACE_INITIALIZED = SBIWA_C_FLAG_ON.
ENDIF.
Check for supported update mode
CASE I_UPDMODE.
WHEN SBIWA_C_UPDMODE_FULL.
WHEN SBIWA_C_UPDMODE_DELTAINIT.
WHEN SBIWA_C_UPDMODE_DELTA.
WHEN OTHERS.
IF 1 = 2. MESSAGE E011(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'011' "message number
I_UPDMODE "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
Initialize variable to read compound information
i_chabasnm_cmp = i_chabasnm. "note383430 insED08052001
**Check InfoObject validity and set IO-dependent parameters
G_TAB1_FLG = G_TAB2_FLG = G_TAB3_FLG = G_TAB4_FLG = ' '.
g_tab5_flg = ' '. "note417314 insED04072001
G_NO_MARM = 'X'.
CASE I_CHABASNM.
WHEN '0MATERIAL'.
G_TAB1_FLG = 'X'.
G_TABLENAME = 'MARA'.
WHEN '0ARTICLE'. "note383430 insED30042001
G_TAB1_FLG = 'X'. "note383430 insED30042001
G_TABLENAME = 'MARA'. "note383430 insED30042001
i_chabasnm_cmp = '0MATERIAL'. "note383430 insED08052001
WHEN '0ME_MATERIAL'. "note759687
G_TAB1_FLG = 'X'. "note759687
G_TABLENAME = 'MARA'. "note759687
i_chabasnm_cmp = '0MATERIAL'. "note759687
WHEN '0MAT_PLANT'.
G_TAB2_FLG = 'X'.
G_TABLENAME = 'MARC'.
WHEN '0ART_PLANT'. "note383430 insED30042001
G_TAB2_FLG = 'X'. "note383430 insED30042001
G_TABLENAME = 'MARC'. "note383430 insED30042001
i_chabasnm_cmp = '0MAT_PLANT'. "note383430 insED08052001
WHEN '0MAT_ST_LOC'.
G_TAB3_FLG = 'X'.
G_TABLENAME = 'MARD'.
WHEN '0ART_ST_LOC'. "note383430 insED30042001
G_TAB3_FLG = 'X'. "note383430 insED30042001
G_TABLENAME = 'MARD'. "note383430 insED30042001
i_chabasnm_cmp = '0MAT_ST_LOC'. "note383430 insED08052001
WHEN '0MAT_SALES'.
G_TAB4_FLG = 'X'.
G_TABLENAME = 'MVKE'.
when '0ART_SALES'. "note383430 insED30042001 "delED
g_tab4_flg = 'x'. "note383430 insED30042001 "delED
g_tablename = 'MVKE'. "note383430 insED30042001 "delED
WHEN '0ART_SALES'. "insED
G_TAB4_FLG = 'X'. "insED
G_TABLENAME = 'MVKE'. "insED
i_chabasnm_cmp = '0MAT_SALES'. "note383430 insED08052001
WHEN '0MAT_UNIT'.
G_TAB1_FLG = 'X'. "note417314 delED04072001
g_tab5_flg = 'X'. "note417314 insED04072001
G_TABLENAME = 'MARM'.
G_NO_MARM = ' '.
WHEN OTHERS.
IF 1 = 2. MESSAGE E009(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'009' "message number
I_CHABASNM "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
** fill parameter buffer for data extraction calls
G_S_EXTR_IF-REQUNR = I_REQUNR.
G_S_EXTR_IF-CHABASNM = I_CHABASNM.
G_S_EXTR_IF-MAXSIZE = I_MAXSIZE.
G_S_EXTR_IF-INITFLAG = I_INITFLAG.
G_S_EXTR_IF-UPDMODE = I_UPDMODE.
G_S_EXTR_IF-DATAPAKID = I_DATAPAKID.
g_s_interface-read_opt =.
G_S_INTERFACE-MAX_MATNR = I_MAXSIZE.
g_s_interface-max_lifnr =.
g_s_interface-max_kunnr =.
g_s_interface-max_werks =.
CASE I_UPDMODE.
WHEN SBIWA_C_UPDMODE_DELTA.
** settings for delta data transfer
** get additional information about current extraction
CALL FUNCTION 'RSAN_LOGSYS_DETERMINE'
EXPORTING
I_CLIENT = SY-MANDT
IMPORTING
E_LOGSYS = L_SLOGSYS.
L_S_REQUEST-SNDPRN = L_SLOGSYS.
L_S_REQUEST-RCVPRN = I_RLOGSYS.
*----- Fill Content release so get_rodchabgen will work ok -
PERFORM GET_BWBCRL IN PROGRAM SAPLRSAP "OSS 1054070/2000
USING L_S_REQUEST-RCVPRN "OSS 1054070/2000
CHANGING L_SUBRC. "OSS 1054070/2000
PERFORM GET_RODCHABGEN IN PROGRAM SAPLRSAP
USING L_RODCHABGEN
I_CHABASNM
L_S_REQUEST.
** get base characteristic information
PERFORM DETERMINE_COMPOSITES IN PROGRAM SAPLRSAM
TABLES L_T_CHABASCMP
USING I_CHABASNM.
USING i_chabasnm_cmp. "note383430 insED08052001
** Get information about modified data objects
PERFORM FILL_MD_SELECT_ENTRYTABLE IN PROGRAM SAPLRSAP
TABLES L_T_CHABASCMP
USING L_RODCHABGEN-MSGTYP
I_CHABASNM
CHANGING L_TX_SELECT
L_SUBRC.
DESCRIBE TABLE L_TX_SELECT LINES L_LINES.
IF L_LINES = 0.
L_NO_SELECT = 'X'.
ENDIF.
** fill key-table for extractor
REFRESH G_T_MATNR_MATERIAL_KEYS.
REFRESH G_T_WERKS_MATERIAL_KEYS.
REFRESH G_T_LGORT_MATERIAL_KEYS.
REFRESH G_T_VTLIN_MATERIAL_KEYS.
refresh g_t_marm_material_keys. "note417314 insED04072001
LOOP AT L_TX_SELECT INTO L_T_SELECT.
CASE I_CHABASNM.
WHEN '0MATERIAL' OR '0ARTICLE' "note383430 insED30042001
OR '0ME_MATERIAL'.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'MATNR'.
L_S_MATNR_MATERIAL_KEYS-MATNR = L_S_SELECT-LOW.
APPEND L_S_MATNR_MATERIAL_KEYS TO G_T_MATNR_MATERIAL_KEYS.
WHEN '0MAT_PLANT' OR '0ART_PLANT'. "note383430 insED30042001
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'MATNR'.
L_S_WERKS_MATERIAL_KEYS-MATNR = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'WERKS'.
L_S_WERKS_MATERIAL_KEYS-WERKS = L_S_SELECT-LOW.
APPEND L_S_WERKS_MATERIAL_KEYS TO G_T_WERKS_MATERIAL_KEYS.
WHEN '0MAT_ST_LOC' OR '0ART_ST_LOC'.
"note383430 insED30042001
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'MATNR'.
L_S_LGORT_MATERIAL_KEYS-MATNR = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'WERKS'.
L_S_LGORT_MATERIAL_KEYS-WERKS = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'LGORT'.
L_S_LGORT_MATERIAL_KEYS-LGORT = L_S_SELECT-LOW.
APPEND L_S_LGORT_MATERIAL_KEYS TO G_T_LGORT_MATERIAL_KEYS.
WHEN '0MAT_SALES' OR '0ART_SALES'. "note383430 insED30042001
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'MATNR'.
L_S_VTLIN_MATERIAL_KEYS-MATNR = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'VKORG'.
L_S_VTLIN_MATERIAL_KEYS-VKORG = L_S_SELECT-LOW.
READ TABLE L_T_SELECT
INTO L_S_SELECT
WITH KEY FIELDNM = 'VTWEG'.
L_S_VTLIN_MATERIAL_KEYS-VTWEG = L_S_SELECT-LOW.
APPEND L_S_VTLIN_MATERIAL_KEYS TO G_T_VTLIN_MATERIAL_KEYS.
ENDCASE.
ENDLOOP.
IF L_SUBRC <> 0.
IF 1 = 2. MESSAGE E009(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'009' "message number
I_CHABASNM "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
EXIT.
ENDIF.
** settings for full data transfer or delta init.
*----- Selektionsbedingungen müssen immer übernommen werden -
WHEN sbiwa_c_updmode_full "DEL"TH090800
OR sbiwa_c_updmode_deltainit. "DEL"TH090800
REFRESH g_t_sel_table. "DEL"TH090800
LOOP AT i_t_select INTO l_s_select. "DEL"TH090800
g_s_sel_table-table = g_tablename. "DEL"TH090800
g_s_sel_table-field = l_s_select-fieldnm. "DEL"TH090800
MOVE-CORRESPONDING l_s_select TO g_s_sel_table. "DEL"TH090800
APPEND g_s_sel_table TO g_t_sel_table. "DEL"TH090800
ENDLOOP. "DEL"TH090800
WHEN OTHERS.
ENDCASE.
*----- Selektionsbedingungen müssen immer übernommen werden -
REFRESH G_T_SEL_TABLE. "INS"TH090800
LOOP AT I_T_SELECT INTO L_S_SELECT. "INS"TH090800
G_S_SEL_TABLE-TABLE = G_TABLENAME. "INS"TH090800
G_S_SEL_TABLE-FIELD = L_S_SELECT-FIELDNM. "INS"TH090800
MOVE-CORRESPONDING L_S_SELECT TO G_S_SEL_TABLE. "INS"TH090800
APPEND G_S_SEL_TABLE TO G_T_SEL_TABLE. "INS"TH090800
ENDLOOP. "INS"TH090800
REFRESH G_T_FIELDS.
APPEND LINES OF I_T_FIELDS TO G_T_FIELDS.
ELSE. "Initialization mode or data extraction ?
IF ( G_MORE_DATA_EXISTS = ' ' ) AND ( G_COUNTER_DATAPAKID NE 0 ).
RAISE NO_MORE_DATA.
EXIT.
ENDIF.
IF G_S_EXTR_IF-UPDMODE = SBIWA_C_UPDMODE_DELTA.
IF NOT L_NO_SELECT IS INITIAL.
RAISE NO_MORE_DATA.
ENDIF.
ENDIF.
IF ( G_MORE_DATA_EXISTS = 'X' ) OR ( G_COUNTER_DATAPAKID = 0 ).
REFRESH L_T_MARA.
REFRESH L_T_MARC.
REFRESH L_T_MARD.
REFRESH L_T_MVKE.
REFRESH L_T_MARM.
CALL FUNCTION 'MATERIAL_DYNAM_DATA_SELECTION'
EXPORTING
NO_MARM_DATA = G_NO_MARM
READ_MARA_DATA = G_TAB1_FLG
READ_MARC_DATA = G_TAB2_FLG
READ_MARD_DATA = G_TAB3_FLG
READ_MVKE_DATA = G_TAB4_FLG
read_marm_data = g_tab5_flg "note417314 insED04072001
JOIN_OPTION = 'O'
IN_MAX_MATNR = G_S_INTERFACE-MAX_MATNR
TABLES
IN_SELECT_FIELDS = G_T_SEL_TABLE
IN_MATNR_KEYS = G_T_MATNR_MATERIAL_KEYS
IN_WERKS_KEYS = G_T_WERKS_MATERIAL_KEYS
IN_VTLIN_KEYS = G_T_VTLIN_MATERIAL_KEYS
IN_LGORT_KEYS = G_T_LGORT_MATERIAL_KEYS "insED22032001
in_marm_keys = g_t_marm_material_keys "note417314
"insED04072001
OUT_MARA_TAB = L_T_MARA
OUT_MARC_TAB = L_T_MARC
OUT_MARD_TAB = L_T_MARD
OUT_MVKE_TAB = L_T_MVKE
OUT_MARM_TAB = L_T_MARM
CHANGING
MORE_DATA_EXISTS = G_MORE_DATA_EXISTS
EXCEPTIONS
WRONG_INPUT_DATA = 1
OTHERS = 2
IF SY-SUBRC <> 0.
IF 1 = 2. MESSAGE E011(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'011' "message number
SY-SUBRC "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDIF.
G_COUNTER_DATAPAKID = G_COUNTER_DATAPAKID + 1.
LOOP AT L_T_MARA.
MOVE-CORRESPONDING L_T_MARA TO E_T_BIW_MARA_S.
APPEND E_T_BIW_MARA_S.
ENDLOOP.
LOOP AT L_T_MARC.
MOVE-CORRESPONDING L_T_MARC TO E_T_BIW_MARC_S.
provide additional attributes not contained in MARC
PERFORM MARC_ADD_ATTRIBUTES CHANGING E_T_BIW_MARC_S
L_SUBRC.
IF L_SUBRC <> 0.
IF 1 = 2. MESSAGE E501(R§). ENDIF.
"insED03082001 begin note216922
log_write 'W' "message type
'R§' "message class
'501' "message number
e_t_biw_marc_s-werks "message variable 1
' '. "message variable 2
"insED03082001 end note216922
"delED03082001 begin note216922
LOG_WRITE 'E' "message type
'R§' "message class
'501' "message number
E_T_BIW_MARC_S-WERKS "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
"delED03082001 end note2169222
ENDIF.
APPEND E_T_BIW_MARC_S.
ENDLOOP.
LOOP AT L_T_MARD.
MOVE-CORRESPONDING L_T_MARD TO E_T_BIW_MARD_S.
APPEND E_T_BIW_MARD_S.
ENDLOOP.
LOOP AT L_T_MVKE.
MOVE-CORRESPONDING L_T_MVKE TO E_T_BIW_MVKE_S.
APPEND E_T_BIW_MVKE_S.
ENDLOOP.
LOOP AT L_T_MARM.
MOVE-CORRESPONDING L_T_MARM TO E_T_BIW_MARM_S.
APPEND E_T_BIW_MARM_S.
ENDLOOP.
ENDIF.
ENDIF.
ENDFUNCTION.
ThanksHi,
This might not be the right forum for this. You can post your question in more relevant forum like Netweaver-Exchange Infrastructure. -
Excel Save As functionality using ABAP
Hi Gurus,
I have an Excel file on Presentation server. I need to save this file in specified directory in Presentation server (Means Save As functionality). How can I do it in ABAP.
Is there any API available. Could you help me on this.
Thanks,
RayuduHi,
To upload the Excel file, please refer this thread :
Re: Upload excel file
To download the Excel file on application server, please refer this thread :
Excel download in Application Server
To summarize :
You need to use GUI_UPLOAD to upload the excel file and need to use FM MS_EXCEL_OLE_STANDARD_DAT to download the excel file on application server.
Best regards,
Prashant -
Call function in abap routine of infopackage
Experts,
Good day. I have a problem concerning the data to be imported in my ods.I can't find a similar thread corcerning my problem. My File date field should contain only 2 years and 3months data of recent data. I'm using a call function fima_date_create to filter values of zfile_date.
CALL FUNCTION 'FIMA_DATE_CREATE'
EXPORTING
I_DATE = sy-datum
I_FLG_END_OF_MONTH = ' '
I_YEARS = 2-
I_MONTHS = 3-
I_DAYS = 0
I_CALENDAR_DAYS = 0
I_SET_LAST_DAY_OF_MONTH = ' '
IMPORTING
E_DATE =
E_FLG_END_OF_MONTH =
E_DAYS_OF_I_DATE =
The sy-datum becomes the High value and the date generated by this FM will be the low value. I already tested this function module and it is what i want. How Should I write the ABAP code for this in the abap routine for my infopackage? Or what steps do I need to take.Hi,
When you choose the option to write a routine for one of the characteristics in the infopackage selections, you get a window to write your code with some prewritten code as below. Modify it as shown below, for your requirement.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'CALDAY'.
l_idx = sy-tabix.
START of YOUR CODE
<----
Required logic -
>
L_T_RANGE-LOW = <lower limit of range>.
L_T_RANGE-HIGH = <upper limit of range>.
L_T_RANGE-SIGN = 'I'.
L_T_RANGE-OPTION = 'BT'.
END of YOUR CODE
modify l_t_range index l_idx.
p_subrc = 0.
Hope this helps. -
How to implement this calendar function in ABAP code
Hi everyone,
Our requirement is : Give a date (e.g. YYYY.MM.DD, 1983.12.26), then we need to know which weekday it is. Is there a existing FM for this fuction? or how to implement it in ABAP?
Thanks a lot for any hint
Best regards
DeyangHi Deyang Liu,
Could you please check these the below links they would give you some idea ....[SAP Calendar Control|http://help.sap.com/printdocu/core/print46b/en/data/en/pdf/BCCICALENDAR/SAP_KALENDER.pdf]
[Calendar functions |http://help.sap.com/saphelp_nw04/Helpdata/EN/2a/fa00f6493111d182b70000e829fbfe/content.htm]
[SAP Functions|http://abap4.tripod.com/SAP_Functions.html]
[Determine calendar |http://help.sap.com/saphelp_nw04/helpdata/en/2a/fa00e9493111d182b70000e829fbfe/content.htm]
Regards,
S.Manu -
Call PL/SQL Function in ABAP over XI
Hi all,
is it possible to call a PL/SQL function in a BW-ABAP over XI and to get back the return value of the function. What proxy do i need and how should the coding look like if it is possible.
I am thankful for every little help.
PeterYou can do a client proxy to JDBC scnario in XI. If you have a stored procedure on the Database side you can call it using SQL XML message type.
Search for the JDBC receiver adapter documentation on help.sap.com
VJ -
Calling IP function in ABAP report
Hi guys,
I would like to execute a planning function of BIIP from an ABAP report. Which function module has to be used or is there a different approach? For the old BPS planning function there was the API_SEM_BPS....
Regards
StefanHi Stefan,
I think there is no way to call a planning function of IP in a report. But we can call planning sequences using the program
RSPLS_PLSEQ_EXECUTE.
In your case, you can create a planning sequence which contains the planning function and filter, and in your ABAP report, call the program RSPLS_PLSEQ_EXECUTE using the statement SUBMIT.
Also, you can use the statement SUBMIT VIA SELECTION-SCREEN which will prompt you to give the Planning Sequence name at run-time of the execution of the ABAP report.
Hope this helps.
Please revert if unresolved.
Regards,
Srinivas Kamireddy.
Maybe you are looking for
-
Survey in MobileSales 4.0 SP06
Hi Everyone, I am trying to download questionnaire created in CRM server to my mobile client4.0. I have created questionnaire in survey suite tool in CRM backend server.My CRM server is non unicode server,And in Mobile sales I am getting an error "<b
-
Current objectives and next yearu2019s objectives in one appraisal document
I keep coming across the requirement for an employee to be able to record comments and scores for his/her current objectives and at the same time to document his/her objectives for the next year in the same appraisal document. The SAP standard proces
-
My iPhone 4S locks up when I select a link to go to a website from emails
My iPhone 4S locks up when I select a link to go to a website from emails It's not all the time but most of the time. I receive an email from a store, click on the link to their site and mail then freezes. I cannot do anything with mail until I turn
-
How do i View 3D Side by Side Movies on Mac? any video players available?
hi, i am currently getting a 3D Monitor Viewsonic V3D231.. and have some side by side movies... which player do i use for Mac to view the content in 3D ? ( Passive 3D ) any stereo movie player available for Mac? Thanks
-
Errors with getInstanceVariables() method
When trying to use the getInstanceVariables() method in a JSP, it doesn´t recognize the sintaxis used which is like the example used on the BEA manuals: List list = admin.getInstanceVariables(task.getInstanceId()); The problem is as follows: when try