Skip to Content
0
Former Member
Jul 31, 2006 at 11:13 PM

Capture data after 'call transaction using bdcdata'

427 Views

Hallo,

I am working with an object Delegation to PDOTYPE_SH, and i have build the dialogue method ZCREATEDIALOGPP03, which call PP03 creates a new HR position. Some of the data (as you can see in my semplified method below) necessary to create the position are passed using the call transaction for PP03 using bdc.

At the end, I would like to get the new Position ID created, to use it and pass it on for further processing.

How can I capture that in my method?

Please have a look below at my code.

Regards,

Marco

-


BEGIN_METHOD ZCREATEDIALOGPP03 CHANGING CONTAINER.

DATA:

objtype type PPHDR-OTYPE,

BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

  • prepare parameter ID

objtype = 'S'.

  • set paramater ID PP03

SET PARAMETER ID 'POT' FIELD objtype.

  • open bdc call

clear bdcdata.

refresh bdcdata.

  • bdc for Position Text

perform bdc_dynpro tables bdcdata using 'MP100000' '2000'.

perform bdc_field tables bdcdata using 'P1000-STEXT' PLSTX.

  • call transaction PP03

Call transaction 'PP03' using bdcdata.

end_method.

----


  • Start new screen *

----


FORM BDC_DYNPRO tables ibdcdata USING PROGRAM DYNPRO.

DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA to ibdcdata.

ENDFORM.

----


  • Insert field *

----


FORM BDC_FIELD tables ibdcdata USING FNAM FVAL.

DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

  • DATA: NODATA_CHARACTER VALUE '/'.

  • IF fval <> NODATA_CHARACTER.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA to ibdcdata.

  • ENDIF.

ENDFORM.

----