Regarding macros in abap
DEFINE macro_split_row_define.
..selection-screen begin of line.
..selection-screen position 10.
..parameters: sp_s&1 as checkbox default 'X' modif id noi.
..selection-screen position 12.
..selection-screen comment (1) text-f41 for field sp_s&1.
..parameters: sp_p&1 like rv56_vt04-f_gestext.
..selection-screen comment (1) text-f41 for field sp_p&1.
..selection-screen pushbutton 62(4) sp&1 user-command sp&1
modif id dsp.
..selection-screen end of line.
END-OF-DEFINITION.
Why they are using periods before selection-screen pleasee help me its urgent?
The dots (.) before the selection-screen does not matter at all. It still works the same way as without dots before the selection-screen.
Hope this helps.
Thanks,
Balaji
Similar Messages
-
Hi Gurus,
What is the exact use of macros in abap-hr.Because in normal abap also these macros are existing , but we will not use these in normal abap programming.So is there any specific reason for using macros in ABAP-HR.
Thanks in advance..
Regards,
Rakesh.This is similar to Logical Database usage. We use LDBs in HR more than in other module. SAP has created many macros that can be used in HR. Ex: you have some macros to make use of when using PNP LDB in your program. Similarly SAP provided macros to read text from PCL1 cluster table. Same thing with reading payroll results. In addition you also can define your own macros in the program and use them in the code.
-
Hi
Is there any way I can see the Macros in abap? ( I mean over view ) .
Cheers
UsmanYes See the table in SM30 <u><b>TRMAC</b></u> . Youll get all Macros ..
Please award point if its help you .
Thanks
SK
Message was edited by: Saquib Khan -
Regarding the PPT or documents to give session regarding the HR- ABAP
Hi all,
Well and wish same from you.. Can please share the PPT or documents to give session regarding the HR- ABAP.
Thanks ,
SureshHi ,
Please send to my personal id [email protected].
Thanks in advance..
Suresh. -
How to translate an excel macro to ABAP code
Hi Guys,
My requirement is need to put the subtotaling option w.r.t divison when i download the file to an excel sheet via OLE.
Iam able to get the records in the excel sheet but unable to write the macro in ABAP code.
the macro which i recorded in Excel is
Range("A1:C3").Select
Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(3), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
how do i convert this into ABAP code .Pls help. Thanks...
the data might be like
NAME DIVISION AMOUNT
ABC IT 400
DEF BPO 500
HTG IT 400Hi,
You can run an excel macro like this
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
Call Method of h_excel 'WORKBOOKS' = h_mapl.
set property of h_excel 'VISIBLE' = 0.
Call Method of h_mapl 'OPEN'
EXPORTING
#1 = d_file.
CALL METHOD OF H_EXCEL 'ActiveWorkbook' = h_book .
CALL METHOD OF H_book 'Activesheet' = H_sheet .
CALL METHOD OF h_excel 'RUN'
EXPORTING
#1 = ld_macro.
Check the links below as well
http://sample-code-abap.blogspot.com/2009/07/controlling-excel-using-ole-automation.html
http://arthur_ong.tripod.com/xab017.htm -
Translating an excel macro to ABAP
Hi Guys,
My requirement is need to put the subtotaling option w.r.t divison when i download the file to an excel sheet via OLE.
Iam able to get the records in the excel sheet but unable to write the macro in ABAP code.
the macro which i recorded in Excel is
Range("A1:C3").Select
Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(3), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
how do i convert this into ABAP code .Pls help. Thanks...
the data might be like
NAME DIVISION AMOUNT
ABC IT 400
DEF BPO 500
HTG IT 400Hi,
You can run an excel macro like this
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
Call Method of h_excel 'WORKBOOKS' = h_mapl.
set property of h_excel 'VISIBLE' = 0.
Call Method of h_mapl 'OPEN'
EXPORTING
#1 = d_file.
CALL METHOD OF H_EXCEL 'ActiveWorkbook' = h_book .
CALL METHOD OF H_book 'Activesheet' = H_sheet .
CALL METHOD OF h_excel 'RUN'
EXPORTING
#1 = ld_macro.
Check the links below as well
http://sample-code-abap.blogspot.com/2009/07/controlling-excel-using-ole-automation.html
http://arthur_ong.tripod.com/xab017.htm -
How to call HR Macros in ABAP-Webdynpro
HI all,
I want to extract HR data in webdynpro view.
Where should I give Logical Database PNP?
The ifnotypes key word is not accepting in Webdynpro coding?
Where should I give GET PERNR event in Webdynpro?
When I use RP_PROVIDE_FROM_LAST .... says error message
Statement "RP_PROVIDE_FROM_LAST" is not defined. Check your spelling .
How to use the Macros in Webdynpro (VIEW) methods.
First time I'm working in ABAP-HR Webynpro.
Please help me out..
Thanks,
PrasadHi,
How did u solve this? pls provide the solution.
Regards,
Lakshmi. -
Running Excel macros from ABAP
Hello everyone,
I am trying to execute an Excel macro from an ABAP program. We are currently on a 46C system. While doing some research on help.sap.com I came across the method execute_macro in class i_oi_document_proxy. Ive never used methods in ABAP before and Im not really sure what Im doing. Has anyone got this to work? When I try to run the program it dumps with error OBJECTS_OBJREF_NOT_ASSIGNED.
Thanks,
Becky
Here is the program:
REPORT ztest_program.
INCLUDE ole2incl.
DATA gs_excel TYPE ole2_object .
DATA gs_wbooks TYPE ole2_object .
DATA gs_wbook TYPE ole2_object .
DATA gs_application TYPE ole2_object .
DATA: h_sheet TYPE ole2_object.
DATA: document TYPE REF TO i_oi_document_proxy.
*Name of the macro in Excel
DATA: macro_string(50) TYPE c
VALUE 'FB03process.FromTheBeginning',
no_flush TYPE c,
param_count TYPE i VALUE 0,
script_name TYPE c VALUE 'X',
error TYPE REF TO i_oi_error
OCCURS 0 WITH HEADER LINE,
retcode TYPE soi_ret_string,
error_string(50) TYPE c,
retvalue(30) TYPE c.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = text-007
EXCEPTIONS
OTHERS = 1.
CREATE OBJECT gs_excel 'EXCEL.APPLICATION' .
SET PROPERTY OF gs_excel 'Visible' = 1 .
GET PROPERTY OF gs_excel 'Workbooks' = gs_wbooks .
GET PROPERTY OF gs_wbooks 'Application' = gs_application .
*--Opening the existing document
CALL METHOD OF gs_wbooks 'Open' = gs_wbook
EXPORTING #1 = 'D:\temp\FB03process.xls' .
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
text = text-009
EXCEPTIONS
OTHERS = 1.
GET PROPERTY OF gs_excel 'ACTIVESHEET' = h_sheet.
CALL METHOD document->execute_macro
EXPORTING macro_string = macro_string
param_count = param_count
script_name = script_name
no_flush = no_flush
IMPORTING error = error
retcode = retcode
CHANGING error_string = error_string
retvalue = retvalue.
disconnect from Excel
FREE OBJECT gs_excel.
PERFORM err_hdl.
FORM err_hdl.
IF sy-subrc <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), sy-subrc.
STOP.
ENDIF.
ENDFORM. " ERR_HDLHi,
Please correct me if I am wrong but it seems that you have not fetched a handle to the document object before issuing the statement CALL METHOD document->execute_macro. Hence the error OBJECTS_OBJREF_NOT_ASSIGNED is being dislayed. If you want to use SAP Desktop Office Integration using ABAP Objects, take a look at this article at http://www.intelligenterp.com/feature/archive/ or http://www.sapinfo.net/public/en/index.php4/article/comvArticle-193333c63b4bd807d2/en/articleStatistic
Hope this helps.
Regards
Message was edited by: Shehryar Khan -
Hi everybody,
Could someone help me finding a way to run a macro of an excel sheet with an ABAP program.
Explanation:
- I launch an abap program that opened an excel sheet with that kind of code
include ole2incl.
DATA : w_excel type ole2_object,
w_books type ole2_object,
w_book type ole2_object,
w_sheets type ole2_object,
w_sheet type ole2_object,
w_cell type ole2_object,
w_rows type ole2_object,
w_font type ole2_object.
create object w_excel 'Excel.Application'.
CALL METHOD OF W_EXCEL 'WORKBOOKS' = W_BOOKS.
CALL METHOD OF W_SHEET 'CELLS' = W_CELL
exporting #1 = row
#2 = column.
CALL METHOD OF W_SHEET 'SAVEAS'.
With my ABAP program:
- i can open my excel template.
- i can write and format data inside my excel sheet.
- i can close and save my excel sheet.
but i don't how to run the macro that exists in my excel template.
Thank you in advance.Hi,
Executing Excel Macro from SAP ABAP
I am populating data in excel sheet using OLE. This excel document contains Macro.
Is there any way I can start execution of Macro as soon as data is populated in Excel sheet.
If you are using OLE to populate the Excel Sheet then, then yes you can run a macro.
CALL METHOD OF OBJ_EX_APP 'Run'
EXPORTING #1 = MACROSTR.
Adding a Field Exit
To add a field exit first find the data element that is linked to the screen field- the screen number and program
Run program RSMODPRF. You will need to create two function modules one FIELD_EXIT_MEPO_VENDOR and
FIELD_EXIT_MEPO_VENDOR_A
FIELD_EXIT_MEPO_VENDOR should have code simply of input = ouput.
FIELD_EXIT_MEPO_VENDOR_A should have the code for whatever the functionality is required
Go back to RSMODPRF and run the program without parameters. Use the push buttons to assign the screen, 'A' and program. Use the drop down to activate the field list.
This should now work, but there is no way of debugging. For further information look at OSS 29377
program zzdirlist.
for AIX this method also works.
DATA: BEGIN OF TABL OCCURS 0,
TEXT(80) TYPE C,
END OF TABL.
DATA: COMMAND(256) TYPE C.
COMMAND = 'ls'.
CALL FUNCTION 'RFC_REMOTE_PIPE' DESTINATION 'SERVER_EXEC'
EXPORTING COMMAND = COMMAND
READ = 'X'
TABLES PIPEDATA = TABL.
LOOP AT TABL.
WRITE:/ TABL-text.
ENDLOOP.
Open the following link,
http://www.sap-img.com/abap/questions-about-bar-code-printing-in-sap.htm
Regards,
Jagadish. -
Hi,
I am kumar. I got job right now i am a trainee in HR ABAP. I got a doubt.
What is Macro and what is the need of Macros in HR ABAP? Why can't we use subroutines and function modules? what is the difference between Macros, Subroutines and Function Mudules?
bye
phanikumarhi,
Go to se38. CTRL+F8 type in define and press enter.
This is the SAP help about the subject on Macros and helps you understand how they work.
In ABAP HR however there are lots of macros used, which can be found in the table TRMAC.
A couple of these provide easier reading of the code and can help in coding.
Som HR examples are:
rp-provide-from-last, this one selects data from an infotype
RP-LOWDATE-HIGHDATE this one defines the data element low-date and high-date, also used a lot in HR abap.
If you come upon a macro in SAP standard, enter that one in TRMAC sometimes the functionality is explained in that table.
Kind regards, Rob Dielemans -
Calling HR Macros in ABAP-Webdynpro
HI all,
I want to extract HR data in webdynpro view.
Where should I give Logical Database PNP?
The ifnotypes key word is not accepting in Webdynpro coding?
Where should I give GET PERNR event in Webdynpro?
When I use RP_PROVIDE_FROM_LAST .... says error message
Statement "RP_PROVIDE_FROM_LAST" is not defined. Check your spelling .
How to use the Macros in Webdynpro (VIEW) methods.
First time I'm working in ABAP-HR Webynpro.
Please help me out..
Thanks,
PrasadHi,
I suspect that you are in a right forum. Please post it to appropriate forum. -
Issue regarding access of ABAP related services from portal
Dear All,
We need your input in the following issue:
Scenerio:
we have implemented ess 1.2 on ep7.0
here we have gone for "Enhanced Package 2" for TRAVEL for client requirements so Travel Services are ABAP WEBDYNPRO instead of Standard JAVA WEBDYNPRO and we have 2 transaction iviews on portal.
Now when an end user clicks on travel services, the request is forwaded to ABAP WAS. So, we need to maintain two entries in DNS: 1. Portal url, 2. ABAP WAS
Now the client doesnot want to maintain ABAP WAS entry in their dns. BUT if they do not maintain this than end users are not able to access ABAP related services...
Can you please suggest any possible solution for this issue.
Thanks & Regards,
JJHi,
Per SAP Note 1040325, it says "It is not possible if there is another component between the browser and the message server (for example, a portal)." In your case a firewall between the portal and WAS. So a direct connection between the client and the WAS system is required which is a security risk. The section below gives more detail on why this is the case/
The following is a excerpt from the Portal "Network and Communication Security" guide:-
Please note that the requirement for direct access between the client and the backend is well flagged in the documentation. For instance, please refer to the Portal Security Guide, specifically the section "Network and Communication Security" (http://help.sap.com/saphelp_nw04s/helpdata/en/b9/c892f1ffc34156883ddd24aec01253/frameset.htm):
'Neither the portal nor the AS Java provides a proxy function. [...] If you have set up a network architecture with one or more firewalls, and your portal integrates iViews that initiate client-backend communication, you must set up access for the client through the firewalls to the application server in the back end.'
So the only secure solution is to install a webdispatcher in your DMZ and forward the requests from the (5) Portal to the (6) webdispatcher as in the graphic below :-
........................................./-> (3) Webdisp -\....................../-> (5) Portal
(1) Client (IE) -> (2) Firewall |.........................|-> (4) Firewall |
.........................................\-> (6) Webdisp -/......................\-> (7) WAS
The original requests bound for the (5) Portal are relayed via the (3) webdisp1 as you can only have one webdisp connecting to one backend SAP system (Portal OR WAS).
Hope this helps.
Michael -
Hi
I Have worked some macros using PNP Logical database but Can i use macros in PCH logical database?? How can i do?
Some examples please.
Regards
GregoryI do agree with Robert's statement but sometimes these are so easy that you write just one line and you get the data so nicely into your internal tables.
For example :
data : it_0002 type table of pa0002.
RP-READ-INFOTYPE pernr 0002 it_0002 begda enda returns all valid data for that employee into the table it_0002.This is very usually to find the presently active record when you give :
RP-READ-INFOTYPE pernr 0002 it_0002 sy-datum sy-datum.
Other commonly used macros are :
The macro RP-PROVIDE-FROM-LAST retrieves the last(latest) data record which is valid in the data selection period.
The macro RP-PROVIDE-FROM-FRST retrieves the first(start)data record which is valid in the data selection period.
Mathews -
Hi All,
Can anybody give me examples for generating/Printing <b>TREE Reports in ABAP.</b>
If anybody worked on it please send the example programs to my personal mail ID - <b>[email protected]</b>
Thanks in advance.
Thanks & Regards,
Rayeez.Hi Shaik,
check in http://www.sapdevelopment.co.uk/reporting/alv/alvtree.htm
and in SE38 you can find some more
<b>BCALV_TREE_01
BCALV_TREE_02
BCALV_TREE_03
BCALV_TREE_04
BCALV_TREE_05
BCALV_TREE_06
BCALV_TREE_DEMO</b>
regards
Vijay -
Dear All,
I am trying to debug a Macro in SAP standard Extractor. I am unable to understand the line in bold. following is the Macro code:
DEFINE sel.
when &1.
sort s_t_select by fieldnm.
do.
fetch next cursor g_cursor into id.
if sy-subrc eq 0.
<b> import &2 from database &3(bw) id id.</b>
loop at &2.
cond_select = true.
loop at s_t_select.
"delete" entry if select-option does not fit
assign component s_t_select-fieldnm of
structure &2 to <fs_field>.
if sy-subrc ne 0.
log_write 'E' "message type
'MCEX' "message class
'022' "message number
i_isource "message variable 1
s_estruc. "message variable 2
raise error_passed_to_mess_handler.
endif.
move-corresponding s_t_select to cond_select_tab.
append cond_select_tab.
at end of fieldnm.
if not <fs_field> in cond_select_tab.
cond_select = false.
refresh cond_select_tab.
exit.
endif.
refresh cond_select_tab.
endat.
endloop.
if cond_select eq true.
append &2 to e_t_data.
add 1 to counter.
endif.
endloop.
if s_maximum_size le counter.
exit.
endif.
else.
close cursor g_cursor.
s_flg_no_more_data = true.
exit.
endif.
enddo.
END-OF-DEFINITION.
The call is as follow:
sel 'MC13VD0ITM' mc13vd0itm_tab mc13vd0itmsetup.Hi pooja,
1. import &2 from database &3(bw) id id.
IMPORT
(See F1 Help )
2. The macro line
is importing
from database cluster :
internal table &2
from cluster table &3
3. where &2 &3 are the parameters
passed to the macro while calling.
regards,
amit m.
Maybe you are looking for
-
Can't create invoice from the delivery
Hello. Ship out the trade order then i created the delivery and PGI successfully. But when i went to VF01 to invoice the delivery i can´t create it. I take a look to the LOG and this is what i found: Error Log 6910517662 000010 The item
-
Hello I have a problem I want to transform a CSV file to another file with extension .dat and separated by |, I made an adaptor for reading the original file, a routing service for processing the and an adaptor to write the output file, when running
-
Does the extreme take the place of my wireless router?
Hi, Does the Airport Extreme replace my wireless router or does it work off my existing wireless system? Will my Mac Mini also recognise it and allow my Mac Mini to be accessed on the wireless network?
-
Can anybody tell the purpose or use of jsoftphone software in java
I wanted to know the purpose of jsoftphone software in java.
-
Flash plugin doesn't work ,isn't it Support?
flashplayer dosnt work with android under firefox 4 beta