How to create Spool through ABAP program
How to create spool request for Smartforms through program. So I can go in TCODE SP01 and see the output of my smartforms.
Include the below code in ur program .......
DATA: PRINT_PARAMETERS TYPE PRI_PARAMS,
VALID_FLAG TYPE C LENGTH 1.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
IMMEDIATELY = 'X' "C_IMMEDIATELY
*LAYOUT = 'Z_48_144'
*LINE_COUNT = '48'
LINE_SIZE = '255'
*NEW_LIST_ID = C_NEW_LIST_ID
NO_DIALOG = 'X'
RELEASE = 'X'
IMPORTING
OUT_PARAMETERS = PRINT_PARAMETERS
VALID = VALID_FLAG
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4 .
G_PDEST = PRINT_PARAMETERS-PDEST.
NEW-PAGE PRINT ON PARAMETERS PRINT_PARAMETERS
NO DIALOG.
List of write statements to be output.......
NEW-PAGE PRINT OFF.
Reward if useful..............
Similar Messages
-
How to crete Button through ABAP programming
Hello Friends,
I am creating 2 selection screens through ABAP code and using them in my Tabstrip control also created through ABAP programming.
Can I also create button on the selection screen through abap programming. If yes then how, and how to assign funtion code and capture the Function Code???
Moderator Message: Read the below advice.
Edited by: kishan P on Dec 30, 2010 7:44 PMHave a look at F1 help on SELECTION-SCREEN. There should be an example as well.
-
Creation of IDOC through abap program.
hello all,
I hav created idoc through abap program. I hav used FM 'Master_idoc _distrribute'.this program creates an idoc but giving status 30. can any one tell me how to get status 03. I hav already created port, Logical sys,partner no.,distribution model.
My Program is as follows:
ABLES : CRMD_ORDERADM_I,CRMD_ORDERADM_H,CRMD_SCHEDLIN.
DATA : S_CTRL_REC LIKE EDIDC OCCURS 0 WITH HEADER LINE,"Idoc Control Record
ORDER_NO TYPE CRMT_OBJECT_ID VALUE '5000000032'," SEGMENT ORDER DATA
PRODUCT TYPE CRMT_ORDERED_PROD VALUE 'SRV_01',
QUANTITY TYPE CRMT_SCHEDLIN_QUAN VALUE '1.000'.
DATA : ZORDER LIKE ZORDER_NUM OCCURS 0 WITH HEADER LINE.
DATA : T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE. "Data Records
DATA : T_COMM_IDOC LIKE EDIDC OCCURS 0 WITH HEADER LINE. "Generated Communication IDOc
CONSTANTS :
C_ZRZSEG1 LIKE EDIDD-SEGNAM VALUE 'ZORDER_NUM'.
PARAMETERS : C_MESTYP LIKE EDIDC-MESTYP DEFAULT 'ZORDER_IDOC2', "Message Type
C_RCVPRT LIKE EDIDC-RCVPRT DEFAULT 'LS', "Partner type of receiver
C_LOGSYS LIKE EDIDC-RCVPRN DEFAULT 'BSNL_OUT',
C_RCVPOR LIKE EDIDC-RCVPOR DEFAULT 'A000000006',
C_SNDPOR LIKE EDIDC-SNDPOR DEFAULT 'SAPBCD0000',
C_SNDPRN LIKE EDIDC-SNDPRN DEFAULT 'BCDCLNT100',
C_IDOCTP LIKE EDIDC-IDOCTP DEFAULT 'ZORDER2',
C_SNDPRT LIKE EDIDC-SNDPRT DEFAULT 'LS'. "Destination System
***START-OF-SELECTION
START-OF-SELECTION.
PERFORM GENERATE_CONTROL_RECORD.
PERFORM SEND_IDOC.
*& Form generate_control_record
FORM GENERATE_CONTROL_RECORD .
S_CTRL_REC-RCVPOR = C_RCVPOR. "Receiver Port
S_CTRL_REC-MESTYP = C_MESTYP. "Message type
S_CTRL_REC-IDOCTP = C_IDOCTP. "Basic IDOC type
S_CTRL_REC-RCVPRT = C_RCVPRT. "Partner type of receiver
S_CTRL_REC-SNDPOR = C_SNDPOR. "SENDER PORT
S_CTRL_REC-RCVPRN = C_LOGSYS. "Partner number of receiver
S_CTRL_REC-SNDPRT = C_SNDPRT. "Sender Partner type
S_CTRL_REC-SNDPRN = C_SNDPRN. "Sender Partner Number
APPEND S_CTRL_REC.
ENDFORM. " generate_control_record
*& Form send_idoc
FORM SEND_IDOC.
ZORDER-ORDER_NO = ORDER_NO.
ZORDER-PRODUCT = PRODUCT.
ZORDER-QUANTITY = QUANTITY.
APPEND ZORDER.
T_EDIDD-SEGNAM = C_ZRZSEG1.
T_EDIDD-SDATA = ZORDER.
APPEND T_EDIDD.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = S_CTRL_REC
TABLES
COMMUNICATION_IDOC_CONTROL = T_COMM_IDOC
MASTER_IDOC_DATA = T_EDIDD
EXCEPTIONS
ERROR_IN_IDOC_CONTROL = 1
ERROR_WRITING_IDOC_STATUS = 2
ERROR_IN_IDOC_DATA = 3
SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK.
LOOP AT T_COMM_IDOC.
WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.
ENDLOOP.
ENDIF.
ENDFORM. " send_idoc
I hav created segment , basic type,message typealso and release also .I also linked them.
Plz help me.
HemlataHi Hemalatha,
Just call this Progream RSEOUT00 from your Zprogram and pass the basic parameters like IDOC number, Basic type,Partner number etc.
You can check the parameters by executing the Program RSEOUT00.
This Program will change the status of your IDOC 30 to 03.
Thanks.
Note:Reward Points if you find useful. -
How to pass table data to brf plus application through abap program
Dear All,
i have a question related to BRF Plus management through abap program.
In brf plus application end, Field1,field2,field3 these 3 are importing parameters.
Table1->structure1->field4,field5 this is the table,with in one structure is there and 2 fields.
in my abap program, i am getting values of fields let us take field1,field2,field3,field4,field5.
And my question is
1) How to pass fields to BRF Plus application from abap program.
2)How to pass Table data to BRF Plus application from abap program.
3)How to pass Structure data to BRF Plus application from abap program.
4)How to get the result data from BRF Plus application to my abap program.
And finally , how to run FDT_TEMPLATE_FUNCTION_PROCESS.
How do i get the code automatically when calling the function in brf plus application.
Regards
venkata.Hi Prabhu,
Since it is a Custom Fm i cant see it in my system.
Look if u want to bring data in internal table then there could be two ways::
1) your FM should contain itab in CHANGING option , so that u can have internal table of same type and pass through FM,
2) read values one by one and append to internal table.
Thanks
Rohit G -
How to create popup in ABAP webdynpro.
Hi,
I found lot of examples to create a popup/ model window for java webdynpro.
Could anyone give a pointer to an example which explains how to create popup in ABAP webdynpro??
Kind Regards
ShahulHi Thomas:
It worked fine the 1st time. Second time when the user clicks on the button to open up the popup it dumps.
Here is the code in the action for popup:
data: l_cmp_api type ref to if_wd_Component,
l_window_manager type ref to if_wd_window_manager,
l_api type ref to if_wd_View_controller,
l_text type string_table.
l_cmp_api = wd_comp_controller->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
if wd_this->m_popup is initial.
wd_this->m_popup = l_window_manager->create_window(
window_name = 'DOCQSOW'
button_kind = if_wd_window=>co_buttons_ok
message_type = if_wd_window=>co_msg_type_none ).
component_usage_name = 'DOCQUERY_USAGE_1'
l_api = wd_this->wd_get_api( ).
wd_this->m_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_ok
button_text = 'Transfer'
action_name = 'POPUP_CLOSED'
action_view = l_api ) .
wd_this->m_popup->SET_REMOVE_ON_CLOSE( abap_true ).
endif.
wd_this->m_popup->open( ).
Second time when the popup tries to open, I get the following error:
Method: RENDER_WINDOW of program CL_WDR_WINDOW_RENDERER========CP
Method: RENDER_WINDOW of program CL_WDR_CLIENT_SSR=============CP
Method: RENDER_POPUP_WINDOWS of program CL_WDR_CLIENT_SSR=============CP
Method: RENDER_WINDOWS of program CL_WDR_CLIENT_SSR=============CP
Method: IF_WDR_RESPONSE_RENDERER~RENDER_VIEWS of program CL_WDR_CLIENT_SSR=============CP
Method: IF_WDR_RESPONSE_RENDERER~RENDER_USER_INTERFACE_UPDATES of program CL_WDR_CLIENT_SSR=============CP
Method: IF_WDR_CLIENT~SEND_RESPONSE of program CL_WDR_CLIENT_ABSTRACT_HTTP===CP
Method: IF_WDR_CLIENT~SEND_RESPONSE of program CL_WDR_CLIENT_SSR=============CP
Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP
Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
Is there a way to destroy the instance of the m_popup?
Any help is appreciated!
Thanks -
How to create po through batch run
Hi,
how to create po through batch run (through background job)
PrashanthHi Prashanth ,
Run the below program as a background job.
Make sure that inforecord exists for all and automatic PO are ticked in Vendor and Material Master.
Program : RM06BB30
Create a suitable variant.
Job Creation : Tcode : SM36
Regards
Ramesh Ch -
Hi Experts,
How can we send sms through ABAP program. What are the web services required? Is there any tutorial/resource on this topic?
Regards.
AbdullahHi...
Go through this code.....
REPORT y_sms_to_india620.
DATA: http_client TYPE REF TO if_http_client .
DATA: wf_string TYPE string ,
result TYPE string ,
r_str TYPE string .
DATA: result_tab TYPE TABLE OF string.
SELECTION-SCREEN: BEGIN OF BLOCK a WITH FRAME .
PARAMETERS: mail(100) LOWER CASE,
m_no(20) LOWER CASE ,
m_mss(120) LOWER CASE.
SELECTION-SCREEN: END OF BLOCK a .
START-OF-SELECTION .
CLEAR wf_string .
CONCATENATE
'http://www.webservicex.net/SendSMS.asmx/SendSMSToIndia?MobileNumber='
m_no
'&FromEmailAddress='
mail
'&Message='
m_mss
INTO wf_string .
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = wf_string
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
CLEAR result .
result = http_client->response->get_cdata( ).
REFRESH result_tab .
SPLIT result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
LOOP AT result_tab INTO r_str.
WRITE:/ r_str .
ENDLOOP .
Reward if it helps u... -
How to create a ztable using program?
Hi ,
How to create a ztable using programs for SQL database?
Can anyone plz explain it with a program!
Thanks in advance.hi,
Your purpose can be achieved through BDC programming too..
data:
t_bdcdata type table of bdcdata with header line.
start-of-selection.
perform bdc_dynpro using 'SAPMSRD0' '0102'.
perform bdc_field using 'BDC_OKCODE'
'=ADD'.
perform bdc_field using 'RSRD1-TBMA'
'X'.
perform bdc_field using 'RSRD1-TBMA_VAL'
'ztable_demo'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'=CHANGE_MAINTFLAG'.
perform bdc_field using 'DD02D-DDTEXT'
'Ztable'.
perform bdc_field using 'DD02D-CONTFLAG'
'A'.
perform bdc_field using 'DD02D-MAINFLAG'
'X'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'=DEF'.
perform bdc_field using 'DD02D-DDTEXT'
'Ztable'.
perform bdc_field using 'DD02D-CONTFLAG'
'A'.
perform bdc_field using 'DD02D-MAINFLAG'
'X'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'DD02D-DDTEXT'
'Ztable'.
perform bdc_field using 'DD03D-ROLLNAME(01)'
'mandt'.
perform bdc_field using 'DD03D-FIELDNAME(01)'
'mandt'.
perform bdc_field using 'DD03P-KEYFLAG(01)'
'X'.
perform bdc_field using 'DD03P-NOTNULL(01)'
'X'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'DD02D-DDTEXT'
'Ztable'.
perform bdc_field using 'DD03D-ROLLNAME(02)'
'S_CARR_ID'.
perform bdc_field using 'DD03D-FIELDNAME(02)'
'carrid'.
perform bdc_field using 'DD03P-KEYFLAG(02)'
'X'.
perform bdc_field using 'DD03P-NOTNULL(02)'
'X'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'DD02D-DDTEXT'
'Ztable'.
perform bdc_field using 'DD03D-ROLLNAME(03)'
'S_CONN_ID'.
perform bdc_field using 'DD03D-FIELDNAME(03)'
'connid'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'=SE13'.
perform bdc_field using 'DD02D-DDTEXT'
'Ztable'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_dynpro using 'SAPLSTRD' '0100'.
perform bdc_field using 'BDC_CURSOR'
'KO007-L_DEVCLASS'.
perform bdc_field using 'BDC_OKCODE'
'=TEMP'.
perform bdc_field using 'KO007-L_AUTHOR'
'SAPDEV02'.
perform bdc_dynpro using 'SAPMSEDS' '0050'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'DD09V-TABART'
'APPL0'.
perform bdc_field using 'DD09V-TABKAT'
'0'.
perform bdc_field using 'ALLOWSTATE-NOT_ALLOWED'
'X'.
perform bdc_dynpro using 'SAPMSEDS' '0050'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'DD09V-TABART'
'APPL0'.
perform bdc_field using 'DD09V-TABKAT'
'0'.
perform bdc_field using 'ALLOWSTATE-NOT_ALLOWED'
'X'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'=WB_ACTIVATE'.
perform bdc_field using 'DD02D-DDTEXT'
'Ztable'.
perform bdc_dynpro using 'SAPLSEWORKINGAREA' '0205'.
perform bdc_field using 'BDC_OKCODE'
'=WEIT'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=NO'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'=WB_BACK'.
perform bdc_field using 'DD02D-DDTEXT'
'Ztable'.
perform bdc_dynpro using 'SAPMSRD0' '0102'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'RSRD1-TBMA'
'X'.
perform bdc_field using 'RSRD1-TBMA_VAL'
'ZTABLE_DEMO'.
call transaction 'SE11' using t_bdcdata..
form BDC_DYNPRO using value(p_program)
value(p_num).
clear t_bdcdata.
t_bdcdata-program = p_program.
t_bdcdata-dynpro = p_num.
append t_bdcdata.
endform. " BDC_DYNPRO
form BDC_FIELD using value(p_fnam)
value(p_fval).
clear t_bdcdata.
t_bdcdata-fnam = p_fnam.
t_bdcdata-fval = p_fval.
append t_bdcdata.
endform. " BDC_FIELD
Thanks
Sharath -
Creating IDOC from ABAP Program
Hi folks,
Could any one tell me the procedure how to process IDOC form ABAP program. for example i want to send MATMAS idoc to other system. now we are able to send through Tcode BD10 to XI. we jsut want to send through ABAP program. is it possible to do so..if so could u pls let me know the procedure..thanks in advance.
santosh.Just check abap program RBDSEMAT.
In short:
- select the materials you want to send.
- call following function module:
CALL FUNCTION 'MG_IDOC_CREATE_FULL_MAT'
EXPORTING
rcvpfc = ' '
rcvprn = receiver_prn
rcvprt = receiver_prt
sndpfc = ' '
sndprn = ' '
sndprt = ' '
message_type = mestyp
TABLES
marakey = t_matkeypack
EXCEPTIONS
OTHERS = 0. -
How to copy/download all ABAP programs in a text with a single report ?
How to copy/download all ABAP programs in a text format with a single report/TC ?
How to copy/download ABAP source code with all include programs ?....
we need to search & copy all include programs everytime....Hi,
check this link
downloading programs
Regards -
Print an existing spool in ABAP program.
Hi Experts,
I have a problem to print an existing spool.
I need print many an existing spools in ABAP program
- I used the SHDB and call transaction with BDC data but work only for 1st.
- I tried use the RSPO_RPRINT_SPOOLREQ function but don't work.I resolved my own problem.
I use the function RSPO_OUTPUT_SPOOL_REQUEST...
The only parameters to this functions was spool_request_id - ID spool.
Thanks for help! -
How to create a module pool program
Dear Guru
I want to know know how to create a module pool program from se80 step by step. I want to know the steps where i will get the four includes like form routines, PAI, PBO, and global data please its very urgent.
Thanks & regards
Saifur Rahamanhi Saifur Rahaman,
goto se80 then click find program,
next u want any name of the program enter as,
Attribute type as find Module pool click it.
next u want any package and save and activate.
program name with create screen with any number then
click layout and u want any object and save , actived.
click flow logic , four types as PBO and PAI and POV, POH.
PBO---> Trigger is before screen.
its applied for display screen and inactive or no display screen only
PAI--->Trigger is after screen
when u want button then its processed.
POV--> Value requested for F4.
POH-->Help requested for F1.
Reward if useful,
S.Suresh. -
How to create documentation for report programs and how to use it
how to create documentation for report programs and how to use it in the selection screen by placing an icon in the Applicatin Tool bar. If i click this icon the help documentation has to display.
Note: Exaple <b>RSTXSCRP</b> programs selection screenHi
1 goto SE38 transaction, give the program name
2 Click on documentation radiobutton & then press change
3 Write your PURPOSE, PREREQUISITES etc details
4 Save the same & Activae it.
The icon will come automatically on selection screen
Thanks
Sandeep
Reward if useful -
How to create VPN through tunnel
how to create vpn through tunnel
Navazcan you be a little bit more specific what you wnat to achieve?
Don't stop after you've improved your network! Improve the world by lending money to the working poor:
http://www.kiva.org/invitedby/karsteni -
How to find hardcoded in ABAP programs
Dear Experts,
Please tell me how to find hardcoded in ABAP programs.Hi Sam,
Generally in Abap program hardcoded strings are declared in single quotes ' .
for ex :
write : 'Report heading'. " search for ' in the entire program.
press FIND button in menu bar and type single quote ' . and select radio button ' IN MAIN PROGRAM '
Regards,
Aby.
Maybe you are looking for
-
Want to know more about Java//???
Conference and Workshop on Java Enterprise, Agile, JDK, Mobile, Spring, BPEL, EJB 3, Eclipse, Java EE, Cloud Computing and more.. If you work on Java there�s no way you can afford to miss the Daring Java Conference @ Developer Summit 2008, being held
-
I can't keep cookies "until they expire"
Firefox 6.0 My basic problem is that F'Fox won't allow me to stay logged in on my yahoo. To try to fix I followed the instructions on Firefox help. However, Help said that (on the Privacy panel) I should select (keep cookies) "until they expire." How
-
PS_ECQUEUEINST = Cannot insert duplicate key row in object
Running ECIN0001, and getting error [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert duplicate key row in object 'PS_ECQUEUEINST' with unique index 'PS_ECQUEUEINST' Table values look like as under ECTRANSID ECTRANSINOUTSW ECQUEUEINSTANCE
-
Cancel return to subcontractor vendor not possible (error for mvt. 544 O)
Dear guru. I have created a returns po for a subcontracting position. I have executed the goods receipt of return po (161 and 543 O for the component) Then I immediately try to cancel the material document using MBST. The system send an error message
-
Number of enrties in an Internal Table
Hi All, We use describe table ITAB to find the number of lines in the internal table. Is there any other alternative? Thanks, Manjula.S