10-19-2007 8:10 AM
Hi,
Can anyone tell me how can i submit this standard program 'RBDAPP01' from my custom program with current date and idoc status '64' WITHOUT USING VARIANTS?
Can someone provide actual code?
Thank youuu,
10-19-2007 8:13 AM
Hi..
This is the code:
<b>SUBMIT RBDAPP01 WITH CREDAT-LOW = SY-DATUM AND RETURN.</b>
<b>reward if Helpful.</b>
10-19-2007 8:29 AM
it is taking lot of time to and the status message i see is "data is being selected' although there are only 3 idocs for that selection criteria.
I think the parameters are not getting passed properly.. i have used below code
SUBMIT RBDAPP01 WITH CREDAT-LOW = SY-DATUM
WITH STATUS-LOW = 64' AND RETURN.
10-19-2007 8:36 AM
Hi..
It may be bcoz of Lot IDOCs available. So Restrict the selection Further using Message type etc.
Eg
SUBMIT RBDAPP01
WITH CREDAT-LOW = SY-DATUM
WITH STATUS-LOW = 64
WITH MESTYP-LOW = '<Message type>'
AND RETURN.
Note: You can also process it in Background
reward if Helpful.
10-19-2007 8:16 AM
SUBMIT RBDAPP01 WITH credat eq sy-datum
WITH status eq '64'
EXPORTING LIST TO MEMORY
AND RETURN.
regards,
Hans
10-19-2007 8:17 AM
hi,
submit RBDAPP01
with sy-datum
with status = ' 64'
and return.
Reward with points if helpful.
10-19-2007 8:18 AM
Hi,
Use Submit with the parameter name for the idoc and the parameter name for the date.
Like,find out the name of the parameters filed of the standard program of the idoc and the date,then populate them either n the selection table or the variables and pass them along.
Refer to the below code for reference:
REPORT zrat NO STANDARD PAGE HEADING.
************************************************************
*DATA DECLARATION
************************************************************
DATA : BEGIN OF wa_ccode,
bukrs TYPE t001-bukrs,
END OF wa_ccode.
DATA : itab_ccode LIKE TABLE OF wa_ccode.
DATA : BEGIN OF wa_emp,
pernr TYPE pa0001-pernr,
sachp TYPE pa0001-sachp,
sname TYPE pa0001-sname,
END OF wa_emp.
DATA : itab_emp LIKE TABLE OF wa_emp.
DATA : BEGIN OF wa_bdate,
nachn LIKE pa0002-nachn,
vorna LIKE pa0002-vorna,
pernr TYPE pa0002-pernr,
gbdat TYPE pa0002-gbdat,
END OF wa_bdate.
DATA : itab_bdate LIKE TABLE OF wa_bdate.
DATA : new_date LIKE sy-datum.
DATA : diff TYPE i.
DATA : years LIKE p0347-scryy,
months LIKE p0347-scrmm,
days LIKE p0347-scrdd.
DATA : sup_code LIKE pa0001-sachp,
itab_usrid LIKE t526-usrid,
sup_pernr LIKE pa0105-pernr.
DATA : BEGIN OF wa_email,
usrid_long LIKE pa0105-usrid_long,
END OF wa_email.
DATA : sup_email LIKE TABLE OF wa_email.
DATA : gwa_document_data LIKE sodocchgi1,
gc_name TYPE so_obj_nam VALUE 'RETIREMENT',
gc_senst TYPE so_obj_sns VALUE 'P',
gc_size TYPE so_doc_siz VALUE '510',
gi_obj_cnt LIKE TABLE OF solisti1 WITH HEADER LINE,
gi_recievers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
gwa_obj_cnt LIKE LINE OF gi_obj_cnt.
DATA : smtp_addr LIKE adr6-smtp_addr.
DATA : wa_date LIKE sy-datum,
entries LIKE sy-tabix,
name(15),
line1(18) TYPE c,
line2(20) TYPE c,
line3(20) TYPE c,
line4(23) TYPE c,
line5(10) TYPE c,
line6(45) type c,
date(2) TYPE c,
month(2) TYPE c,
year(4) TYPE c.
************************************************************
*START OF SELECTION
************************************************************
SELECT bukrs
FROM t001
INTO TABLE itab_ccode
WHERE land1 EQ 'GB'.
SORT itab_ccode.
DELETE ADJACENT DUPLICATES FROM itab_ccode.
SELECT pernr sachp sname
FROM pa0001
INTO TABLE itab_emp
FOR ALL ENTRIES IN itab_ccode
WHERE bukrs EQ itab_ccode-bukrs AND begda LE sy-datum AND
endda GE sy-datum and persg eq '1'.
SELECT nachn vorna pernr gbdat
FROM pa0002
INTO TABLE itab_bdate
FOR ALL ENTRIES IN itab_emp
WHERE pernr EQ itab_emp-pernr.
************************************************************
*TO CHECK EMPLOYEES WHOSE AGE IS NEAR 75 YEARS.
************************************************************
LOOP AT itab_bdate INTO wa_bdate.
new_date = wa_bdate-gbdat.
************************************************************
*TO CALCULATE THE AGE TILL DATE
************************************************************
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = sy-datum
date2 = new_date
output_format = '05'
IMPORTING
years = years
months = months
days = days
.
IF sy-subrc <> 0.
ENDIF.
IF years EQ 64 AND months EQ 4.
IF days GE 23 AND days LE 31.
************************************************************
*FETCH THE DATA IF THE AGE IS NEARING 75 YEARS
************************************************************
SELECT SINGLE sachp FROM pa0001 INTO sup_code WHERE pernr EQ
wa_bdate-pernr AND begda LE sy-datum AND endda GE sy-datum.
SELECT SINGLE usrid FROM t526 INTO itab_usrid WHERE sachx EQ
sup_code.
SELECT SINGLE pernr FROM pa0105 INTO sup_pernr WHERE usrid EQ
itab_usrid AND subty EQ '0001'.
clear sup_email[].
SELECT usrid_long FROM pa0105 INTO TABLE sup_email WHERE pernr EQ
sup_pernr AND subty EQ '0010'.
************************************************************
*EMAIL ADDRESS OF THE SUPERVISOR TO BE NOTIFIED
************************************************************
CLEAR gi_obj_cnt.
CLEAR gi_recievers.
CLEAR gwa_document_data.
Loop at sup_email into wa_email.
write sy-uline+0(5).
write sy-uline+10(5).
write sy-uline+20(5).
write sy-uline+30(5).
write sy-uline+40(5).
write sy-uline+50(5).
write sy-uline+60(5).
write sy-uline+70(5).
smtp_addr = wa_email-usrid_long.
gi_recievers-receiver = smtp_addr.
gi_recievers-rec_type = 'U'.
gi_recievers-com_type = 'INT'.
APPEND gi_recievers.
Endloop.
smtp_addr = 'Mairi.Davidson@subsea7.com'.
gi_recievers-receiver = smtp_addr.
gi_recievers-rec_type = 'U'.
gi_recievers-com_type = 'INT'.
APPEND gi_recievers.
gwa_document_data-obj_name = gc_name.
gwa_document_data-obj_descr = 'RETIRE'.
gwa_document_data-sensitivty = gc_senst.
gwa_document_data-obj_langu = sy-langu.
************************************************************
*CONTENT OF THE EMAIL TO BE SENT
************************************************************
line1 = 'Please note that '.
line2 = wa_bdate-vorna.
line3 = wa_bdate-nachn.
line4 = ' will be 65 years on '.
line50(4) = wa_bdate-gbdat4(4).
date = line5+2(2).
month = line5+0(2).
year = wa_bdate-gbdat+0(4) + 65.
CONCATENATE date month year INTO line5 SEPARATED BY '.'.
line6 = '.Please complete the Retirement Procedure.'.
CONCATENATE line1 line2 line3 line4 line5 line6 INTO gwa_obj_cnt
SEPARATED BY space.
APPEND gwa_obj_cnt TO gi_obj_cnt.
CLEAR gwa_obj_cnt.
DESCRIBE TABLE gi_obj_cnt LINES entries.
READ TABLE gi_obj_cnt INDEX entries.
gwa_document_data-doc_size = ( entries - 1 ) * 255 + STRLEN( gi_obj_cnt
).
************************************************************
*FUNCTION MODULE TO SEND THE EMAIL TO THE CONCERNED PERSONS
************************************************************
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = gwa_document_data
document_type = 'RAW'
commit_work = 'X'
TABLES
object_content = gi_obj_cnt
receivers = gi_recievers
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
.
************************************************************
*MESSAGE TO BE DISPLAYED AFTER THE EXECUTION
************************************************************
endif.
CASE sy-subrc.
WHEN 0.
LOOP AT gi_recievers.
IF gi_recievers-receiver = space.
name = gi_recievers-rec_id.
ELSE.
name = gi_recievers-receiver.
ENDIF.
IF gi_recievers-retrn_code = 0.
WRITE: / name, ': succesfully sent'.
ELSE.
WRITE: / name, ': error occured'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'Too many receivers specified !'.
WHEN 2.
WRITE: / 'No receiver got the document !'.
WHEN 4.
WRITE: / 'Missing send authority !'.
WHEN OTHERS.
WRITE: / 'Unexpected error occurred !'.
ENDCASE.
ENDIF.
ENDIF.
ENDLOOP.
In case you have any further clarifications,do let me know.
Regards,
Puneet Jhari.
10-19-2007 8:28 AM
hi,
submit RBDAPP01
with sy-datum
with status = ' 64'
and return.
Reward with points if helpful.