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

RFC

Former Member
0 Likes
920

hi to all,

help me in this issue

below is select and rfc used

i need to consider one more ztable to pass the data here it is considerd only one table zsd i also need to consider zsd1 table also and pass the same

SELECT SINGLE * FROM Zsd

  • WHERE ZST = P_ST.

  • CALL FUNCTION 'ZUPD'

  • EXPORTING

  • FROM_DAT = FROM_DT

  • TO_DAT = TO_DT

  • STATUS = 'F'

  • STAT = P_ST

  • date = Zsd-date

  • TABLES

  • GR_STAT_UPD = ITUD.

thanks in advance

kiran kumar.

Message was edited by: kiran kumar

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
840

hi,

The below is a wonderfull piece of coding were we can dynamically access the table using inner join and without mentioning the field names !!!

PARAMETERS: P_MATNR TYPE MATNR.

DATA: BEGIN OF ITAB OCCURS 0.

INCLUDE STRUCTURE MARA.

DATA: WERKS LIKE MARC-WERKS,

END OF ITAB.

DATA: BEGIN OF DY_FIELDS OCCURS 0,

FIELD(61),

END OF DY_FIELDS.

DATA: FIELDS LIKE DFIES OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'DDIF_NAMETAB_GET'

EXPORTING

tabname = 'MARA'

TABLES

DFIES_TAB = FIELDS

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT FIELDS.

CLEAR: DY_FIELDS.

CONCATENATE 'A~' FIELDS-FIELDNAME INTO DY_FIELDS-FIELD.

APPEND DY_FIELDS.

ENDLOOP.

DY_FIELDS = 'B~WERKS'.

APPEND DY_FIELDS.

SELECT (DY_FIELDS)

INTO TABLE ITAB

FROM MARA AS A INNER JOIN MARC AS B

ON AMATNR = BMATNR

WHERE A~MATNR = P_MATNR.

CHECK SY-SUBRC = 0.

rgds

anver

3 REPLIES 3
Read only

anversha_s
Active Contributor
0 Likes
840

Hi,

use JOIN of zsd and zsd1 and put the data to a ITAB.

use that itab in RFC.

rgds

anver

Read only

0 Likes
840

hi anversha,

there r many feilds in two tables how can i use join statemnt.

thanks in advacne

kiran kumar

Read only

anversha_s
Active Contributor
0 Likes
841

hi,

The below is a wonderfull piece of coding were we can dynamically access the table using inner join and without mentioning the field names !!!

PARAMETERS: P_MATNR TYPE MATNR.

DATA: BEGIN OF ITAB OCCURS 0.

INCLUDE STRUCTURE MARA.

DATA: WERKS LIKE MARC-WERKS,

END OF ITAB.

DATA: BEGIN OF DY_FIELDS OCCURS 0,

FIELD(61),

END OF DY_FIELDS.

DATA: FIELDS LIKE DFIES OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'DDIF_NAMETAB_GET'

EXPORTING

tabname = 'MARA'

TABLES

DFIES_TAB = FIELDS

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT FIELDS.

CLEAR: DY_FIELDS.

CONCATENATE 'A~' FIELDS-FIELDNAME INTO DY_FIELDS-FIELD.

APPEND DY_FIELDS.

ENDLOOP.

DY_FIELDS = 'B~WERKS'.

APPEND DY_FIELDS.

SELECT (DY_FIELDS)

INTO TABLE ITAB

FROM MARA AS A INNER JOIN MARC AS B

ON AMATNR = BMATNR

WHERE A~MATNR = P_MATNR.

CHECK SY-SUBRC = 0.

rgds

anver