Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function to Release and Process a batch imput session.

Former Member
0 Likes
1,463

Hi experts,

Does anibody know a function module that i caold use to release a batch imput session? And another to Process it? Like in Transaction SM35. I need this to do this in a certain case of an abap program i'm developing.

Thank-you,

Artur.

Message was edited by:

Artur Rodriguez

11 REPLIES 11
Read only

Former Member
0 Likes
1,342

Did you try to SUBMIT the Report RSBDCSUB from your program?

Arya

Read only

0 Likes
1,342

Yes I did.

It worked in the previous version of the R/3 but we are performing an upgrade; and the same report in R/3 6.0 does not work correctly, it stays waiting and is never processed until you go to sm35, release and press it. This is why i want to add that functions to the code.

Read only

0 Likes
1,342

This is what i'm doing now:

SUBMIT zrsbdcsub USING SELECTION-SET varian

EXPORTING LIST TO MEMORY AND RETURN.

I don't know why I have to release and process it manually to make the BI success.

Read only

0 Likes
1,342

Oh!; i've just seen that the rsbdcsub the program is using is a Z one...

Maybe this is the problem. I'll try to replace it whit the standard one....

Read only

0 Likes
1,342

Ummmm, it does not work.

It would be ok if someone knows the function modules I'm searching.

Thank-you.

Read only

0 Likes
1,342

What do you mean by "it does not work?" Are you getting an error? If so, which one?

Rob

Read only

0 Likes
1,342

The need to <a href="http://help.sap.com/saphelp_nw70/helpdata/en/69/c2508f4ba111d189750000e8322d00/content.htm">Release</a> a session arises only when it is stuck.. ie interrupted while being processed/created. Pl verify the code that creats the session.. I don't see a need to release a session in general.

Arya

Read only

0 Likes
1,342

No, it's not an error. When I execute the report in the old R/3 version (4.6); the same code executes correctly; and so does the job.

But now, after the upgrade to version R/3 6.0 the job does not execute. When I go to transaction sm35 I see the job whit status "In background", and it does never finish.

Thanks,

Artur

Read only

0 Likes
1,342

OK, then the problem is not with RSBDCSUB; it's elsewhere. In your original code, are you closing the batch input session? If so, you might want to show this to your basis people and see if they have any ideas.

Rob

Read only

ferry_lianto
Active Contributor
0 Likes
1,342

Hi,

Please try standard program RSBDCSUB.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,342

*----


  • FORM lanzar_recuento *

*----


  • Función que actualiza la transaccion que le indicamos *

  • *

*----


FORM lanzar_recuento USING value(p_mappe) LIKE biseg-mappe.

DATA: lv_numero LIKE tbtcjob-jobcount, "ID de un job de fondo

lv_jobname LIKE tbtco-jobname, "Nombre job

lv_jobbina LIKE tbtco-jobname, "Nombre job BI

lv_status LIKE tbtcjob-status. "Satus del job

CONCATENATE 'JOB_SM35_' 'P_MAPPE' INTO lv_jobname.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = lv_jobname "Nombre Job

IMPORTING

jobcount = lv_numero "Número Job

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

SUBMIT rsbdcsub

WITH mappe = p_mappe

AND RETURN VIA JOB lv_jobname NUMBER lv_numero.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = lv_numero "Número job

jobname = lv_jobname "Nombre job

strtimmed = 'X' "Inicio inmediato

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

OTHERS = 8.

COMMIT WORK AND WAIT.

*-----Comprobamos que el job se haya ejecutado para continuar.

DO.

CALL FUNCTION 'BP_JOB_STATUS_GET'

EXPORTING

jobcount = lv_numero

jobname = lv_jobname

IMPORTING

status = lv_status

  • HAS_CHILD =

EXCEPTIONS

job_doesnt_exist = 1

unknown_error = 2

parent_child_inconsistency = 3

OTHERS = 4.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF lv_status NE 'F'.

WAIT UP TO 1 SECONDS.

"espere fin trabajo

ELSE.

EXIT.

ENDIF.

ENDDO.

*----Comprobamos que se haya lanzado el BI para continuar.

CLEAR lv_jobbina.

lv_jobbina = p_mappe.

DO.

CALL FUNCTION 'BP_JOB_STATUS_GET'

EXPORTING

  • jobcount = lv_numero

jobname = lv_jobbina

IMPORTING

status = lv_status

  • HAS_CHILD =

EXCEPTIONS

job_doesnt_exist = 1

unknown_error = 2

parent_child_inconsistency = 3

OTHERS = 4.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF lv_status NE 'F'.

WAIT UP TO 1 SECONDS.

"espere fin trabajo

ELSE.

EXIT.

ENDIF.

ENDDO.

ENDFORM. "lanzar_recuento