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

Question Query codeing

Former Member
0 Likes
475

Hello,

i have a query where i select some fields for a batch input map.

For the moment it only works if i put the codeing for the batch input map in the section "END-OF-SELECTION (after List).

In this section i have collect the data for one production order (hard coded) and i do a call transaction for CO02.

I know that i can fill the my internal table "i_bdcdata" (which i create during the qury runtime) at the query run time, but how can i give this table over to the call transaction function which execute batch input map?

kind regards,

Bernhard

Moderator message: please use more descriptive subject lines for your posts, as most people have questions regarding coding when posting here.

Edited by: Thomas Zloch on Mar 24, 2011 11:53 AM

Edited by: Bernhard Schöberl on Mar 24, 2011 12:53 PM

I select with my Infoset several production orders numbers. Now i want to change in this production orders the conversion unit in the routing.

For this i create a extra field where i put some code for a batch input map.


DATA: lt_BDCDATA TYPE TABLE OF bdcdata,
      ls_bdcdata LIKE LINE OF lt_bdcdata.

* first screen
ls_BDCDATA-Program = 'SAPLCOKO1'.
ls_BDCDATA-Dynpro = '0110'.
ls_BDCDATA-DYNBEGIN = 'X'.
APPEND ls_BDCDATA to ztest.
CLEAR ls_BDCDATA.
ls_bdcdata-fnam = 'BDC_CURSOR'.
ls_bdcdata-fval = 'CAUFVD-AUFNR'.
APPEND ls_BDCDATA to lt_bdcdata.
ls_bdcdata-fnam = 'BDC_OKCODE'.
ls_bdcdata-fval = '/00'.
APPEND ls_BDCDATA to lt_bdcdata.
ls_BDCDATA-fnam = 'CAUFVD-AUFNR'.
ls_BDCDATA-fval = '100849337'.
ls_BDCDATA-fnam = 'FLG_OVIEW'.
ls_BDCDATA-fval = 'X'.
APPEND ls_BDCDATA to lt_bdcdata.
CLEAR ls_BDCDATA.
*second screen
ls_BDCDATA-Program = 'SAPLCOVG'.
ls_BDCDATA-Dynpro = '0100'.
ls_BDCDATA-DYNBEGIN = 'X'.
APPEND ls_BDCDATA to lt_bdcdata.
CLEAR ls_BDCDATA.
ls_BDCDATA-FNAM = 'BDC_CURSOR'.
ls_BDCDATA-FVAL = 'AFVGD-VORNR(01)'.
APPEND ls_BDCDATA to lt_bdcdata.
ls_BDCDATA-FNAM = 'BDC_OKCODE'.
ls_BDCDATA-FVAL = '=PICK'.
APPEND ls_BDCDATA to lt_bdcdata.
ls_BDCDATA-FNAM = 'BDC_SUBSCR'.
ls_BDCDATA-FVAL = 'SAPLCOVG                                0801ORD_HEADER'.
APPEND ls_BDCDATA to lt_bdcdata.
ls_BDCDATA-FNAM = 'BDC_SUBSCR'.
ls_BDCDATA-FVAL = 'SAPLCOVG                                0050BUTTONS'.
APPEND ls_BDCDATA to lt_bdcdata.
CLEAR ls_BDCDATA.
.
:
:
.

At the end i execute


CALL TRANSACTION 'CO02' USING lt_bdcdata MODE 'A' UPDATE 'A' MESSAGES INTO MESSTAB.

If i do this in the normal query field i get a short dump, because the system do a commit work after the first production order

Now i put the last code in the Infoset at the "END-Of_SELECTION" part and this works, but only if i put the whole code create batch input map and call transaction code into this section.But now i can only do it for one order not for several.

What i would like to do is. Create the batch input map within a normal addiditon query field and pull this information to the call transaction code. But i don't know how to do this.

2 REPLIES 2
Read only

Former Member
0 Likes
421

Hello,

noboady an idea if this is possible what i want?

Or any other idea to change the conversion units of prodcution order routing within a query?

kind regards,

Bernhard

Read only

0 Likes
421

Solved.

I create for each line in the production order routing one string.

I put in this fields which i need for my batch input


CONCATENATE afko-aufnr ';' afvc-vornr ';' zzroutheaderu ';' zzoperationu INTO istring.

I put all my strings ( i have one istring per line in the routing at one production order)


CONCATENATE zupdate istring INTO zupdate SEPARATED BY '-'.

In the Query code section "End of selection (after list) is can access this field and use the SPLIT command to

seperate my string into an internal table.

Now i use a loop to fill my batch input table and use the command call transaction to run the CO02.