2007 Mar 06 10:39 AM
Hi all,
i need to send data to transaction mb51 and execute this transaction from my program.
my question is: how can i send data to posting date and than execute the transaction.
thanks,
dana.
2007 Mar 06 11:26 AM
mb51 is a report type program.
you need to use the submit statement
ranges r_budat for mkpf-budat.
r_budat-low = sy-datum - 30
r_budat-high = sy-datum.
r_budat-sign = 'I'.
r_budat-option = 'EQ'.
append r_budat.
submit RM07DOCS with budat in r_budat.
Regards,
Ravi
Hi all,
i need to send data to transaction mb51 and execute this transaction from my program.
my question is: how can i send data to posting date and than execute the transaction.
thanks,
dana.
2007 Mar 06 11:03 AM
hi,
i didnt said that to the other data i using the parameter id:
set parameter id 'KOS' field itab_ekkn-KOSTL.
but to the posting date there is no parameter id - is it possible to send
it data?
2007 Mar 06 11:22 AM
Hi dana,
try this:
Definition der BDC-Tabelle
DATA: BEGIN OF BDCDATA OCCURS 500.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
*
DATA: CTU_PARAMS_0 LIKE CTU_PARAMS.
*
REFRESH BDCDATA.
*
PERFORM BDC_DYNPRO USING 'RM07DOCS' '1000'.
PERFORM BDC_FIELD USING 'MATNR-LOW' MATNR.
PERFORM BDC_FIELD USING 'WERKS-LOW' WERKS.
PERFORM BDC_FIELD USING 'LGORT-LOW' SPACE.
PERFORM BDC_FIELD USING 'CHARG-LOW' SPACE.
PERFORM BDC_FIELD USING 'LIFNR-LOW' SPACE.
PERFORM BDC_FIELD USING 'KUNNR-LOW' SPACE.
PERFORM BDC_FIELD USING 'BWART-LOW' SPACE.
PERFORM BDC_FIELD USING 'BWART-HIGH' SPACE.
PERFORM BDC_FIELD USING 'SOBKZ-LOW' SPACE.
PERFORM BDC_FIELD USING 'BUDAT-LOW' BUDAT_LOW.
PERFORM BDC_FIELD USING 'BUDAT-HIGH' BUDAT_HIGH.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '=ONLI'.
*
CALL TRANSACTION 'MB51' USING BDCDATA MODE 'E'.
************************************************************************
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
*
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
*
ENDFORM.
************************************************************************
FORM BDC_FIELD USING FNAM FVAL.
*
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
*
ENDFORM.
************************************************************************
Set the parameters as you need.
Regards, Dieter
2007 Mar 06 11:24 AM
i rather not doing it as batch input.
if you have another solution i glad to hear.
2007 Mar 06 11:27 AM
Hi dana,
it's not an batch-input. It's a call transaction with parameters
which are inserted in the BDC-DATA. Try it and you can see it.
Regards, Dieter
2007 Mar 06 11:26 AM
mb51 is a report type program.
you need to use the submit statement
ranges r_budat for mkpf-budat.
r_budat-low = sy-datum - 30
r_budat-high = sy-datum.
r_budat-sign = 'I'.
r_budat-option = 'EQ'.
append r_budat.
submit RM07DOCS with budat in r_budat.
Regards,
Ravi
2007 Mar 06 12:06 PM
Hai dona touty.....
u can achieve this with the <b>using</b> adition of call transaction(BDC).
just execute the following code once u will undrestand:
REPORT ZTEST_MB51
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA BDCDATA LIKE STANDARD TABLE OF BDCDATA WITH HEADER LINE.
START-OF-SELECTION.
PERFORM BDC_DYNPRO USING 'RM07DOCS' '1000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'BUDAT-LOW'.
PERFORM BDC_FIELD USING 'BUDAT-LOW'
'06.03.2007'.
CALL TRANSACTION 'MB51' USING BDCDATA.
----
Start new screen *
----
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. "BDC_DYNPRO
----
Insert field *
----
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDFORM. "BDC_FIELD
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |