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

BDC for t-code CO48

Former Member
0 Likes
684

Hi,

As per my requirement, i need to perform batch determination while converting the Planned order to Production order.

I should convert only if Suitable Batch is available. But once we prepare the session in BDC, we won't be having any control to determine whether batch is assigned or not . So i have to perform the Batch determination before preparing & processing the session.

Do we have any standard function modules or available programs to cater this requirement.

Thanks,

Surya

3 REPLIES 3
Read only

Former Member
0 Likes
581

1) fm job_open

2) submit report

3) fm job_close

4) finally select table TBTCO

example:

DATA: jobcount_test LIKE tbtcjob-jobcount,

job_released LIKE btch0000-char1,

rcode(2),

strtimmed LIKE btch0000-char1 VALUE 'X'.

DATA jobname LIKE tbtcjob-jobname.

CONCATENATE 'TEST_' sy-repid '_' sy-datum INTO jobname.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = jobname

IMPORTING

jobcount = jobcount_test

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

IF sy-subrc NE 0.

MESSAGE x000(yp) WITH 'JOB-START ' jobname ' failed !!!'.

ELSE.

*--Step insert

SUBMIT rsbdcsub

USER sy-uname VIA JOB jobname NUMBER jobcount_test

WITH mappe = map

WITH von = pdatum

WITH z_verarb = 'X'

AND RETURN .

*

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = jobcount_test

jobname = jobname

strtimmed = strtimmed

targetsystem = sy-host

IMPORTING

job_was_released = job_released

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.

IF sy-subrc > 1.

MESSAGE x000(yp) WITH 'JOB-CLOSE ' jobname ' failed!!!'.

ENDIF.

ENDIF.

Read only

0 Likes
581

Thanks for the reply

Batch -


> not BDC batch session, Batch (CHARG) is an Attribute of Material

Edited by: Surya chowdary on May 19, 2009 8:54 AM

Read only

Former Member
0 Likes
581

I got the Answer,

Use VB_BATCH_DETERMINATION Function module

Edited by: Surya chowdary on May 26, 2009 7:35 AM