Skip to Content

How to read Screen Field value while running BDC ?

Hello,

I came to a requirement where I wanted to read existing values present in screen fields and make it available to my Z report where I am writing BDC code.

I came across but that did not work. According to given link, we need to maintain a variable same as the given name of Field.

This means if there is a value for KSCHL, then we need to declare a work area RV13A (this is as per the output of pressing F1 > Technical properties on the field).

Example:

data: Begin of RV13A,

KSCHL type RV13A-KSCHL,

End of RV13A.

So I created the same but it did not fill the value in RV13A-KSCHL

By the way here is my code:



REPORT ZBDC1.

DATA : gt_bdcdata LIKE TABLE OF bdcdata,

gs_bdcdata LIKE bdcdata,

mode TYPE c,

t_msg TYPE TABLE OF bdcmsgcoll, " Collecting Error messages

w_msg TYPE bdcmsgcoll,

KONP TYPE TABLE OF KONP,

KOMG TYPE KOMG,

BEGIN OF RV13A,

KSCHL TYPE KSCHL,

END OF RV13A.

START-OF-SELECTION.

PERFORM RUN.

FORM fill_bdc USING value(param_program)

value(param_dynpro)

value(param_dynbegin)

value(param_fnam)

value(param_fval).

CLEAR gs_bdcdata.

IF param_dynbegin = 'X' .

gs_bdcdata-program = param_program .

gs_bdcdata-dynpro = param_dynpro .

gs_bdcdata-dynbegin = param_dynbegin .

APPEND gs_bdcdata TO gt_bdcdata.

ELSE.

gs_bdcdata-fnam = param_fnam.

gs_bdcdata-fval = param_fval.

CONDENSE gs_bdcdata-fval.

APPEND gs_bdcdata TO gt_bdcdata.

ENDIF.

ENDFORM.

FORM RUN.

BREAK-POINT.

PERFORM fill_bdc USING 'SAPMV13A' '0100' 'X' ' ' ' '.

PERFORM fill_bdc USING '' '' '' 'BDC_CURSOR' 'RV13A-KSCHL'. " RC13A

PERFORM fill_bdc USING '' '' '' 'RV13A-KSCHL' 'ZXYZ'.

PERFORM fill_bdc USING '' '' '' 'BDC_OKCODE' '/00'.

PERFORM fill_bdc USING 'RV13A501' '1000' 'X' ' ' ' '.

PERFORM fill_bdc USING '' '' '' 'BDC_CURSOR' 'F002-LOW'.

PERFORM fill_bdc USING '' '' '' 'BDC_OKCODE' '=ONLI'.

PERFORM fill_bdc USING '' '' '' 'SEL_DATE' '18.08.2016'.

PERFORM fill_bdc USING '' '' '' 'F001' '1100'.

PERFORM fill_bdc USING '' '' '' 'F002-LOW' '3180404XXXXX'.

PERFORM fill_bdc USING 'SAPMV13A' '1501' 'X' ' ' ' '.

PERFORM fill_bdc USING '' '' '' 'BDC_CURSOR' 'KONP-KBETR(01)'. " RC13A

PERFORM fill_bdc USING '' '' '' 'KONP-KBETR(01)' '11000'.

PERFORM fill_bdc USING '' '' '' 'BDC_OKCODE' '=SICH'.

BREAK-POINT.

* Search for KONP table and KOMG

CLEAR : t_msg, w_msg.

CALL TRANSACTION 'VK12' USING gt_bdcdata

MODE 'A'

UPDATE 'S'

MESSAGES INTO t_msg.

ENDFORM.

In this report, nowhere I am able to read data from screen fields.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Aug 18, 2016 at 02:07 PM

    This thread you mention just contains rubbish. People just didn't understand the question.

    You can't interact with BDC, you fill initially the table and run the BDC, that's all.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 18, 2016 at 11:18 AM

    You are calling vk12 then doing some kind of Transaction .

    After calling the Vk12. Find is there any enhancement point,

    I hope manually adding vk12 or Through the background adding vk12 is both are same (sequence of executions). but it is executing background. what we are doing in front end.

    First find out the trace after calling vk12. is there any enhancement point. Get the value and pass what you are expecting.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.