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

How to Transport Function Module Value to Internal Table

Former Member
0 Likes
3,117

Hi Gurus/Experts.

I have a problem with my new report.

This report is about aging and Net Due Date.

Before, I think I must say sorry because I believe this is an easy question for you all. Because I am a new programmer and new abapper please help me. I don't have a teacher anymore.

First, I try to get all the not cleared invoice document from BSIK table, and then I try to get the net due date from function module to internal table.

In my case, I cant move it from function module to internal table, can someone give me a suggestion please ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,808

And go to ABAPDOCU, search for function module and look at the example provided by SAP

(also check DWDM for more basic abap examples)

Hi Gurus/Experts.

I have a problem with my new report.

This report is about aging and Net Due Date.

Before, I think I must say sorry because I believe this is an easy question for you all. Because I am a new programmer and new abapper please help me. I don't have a teacher anymore.

First, I try to get all the not cleared invoice document from BSIK table, and then I try to get the net due date from function module to internal table.

In my case, I cant move it from function module to internal table, can someone give me a suggestion please ?

17 REPLIES 17
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
2,808

Hi Ri

For each line which you found in BSIK you will have to find dues date for all items one by one. Once the FM retruns you dues date..fill you work area field and modify the internal table

Nabheet

Read only

0 Likes
2,808

Hi nabheet,

can you give me an example please ??

Read only

0 Likes
2,808

Lets say your are using ABC fm inside loop which return due date for one line item at a time.

Loop IT_BSID.

lv_tabix = sy-tabix.

CALL FM ABC which return value in LV_DUEDATE.

IT_BSID-DUEDATE = lV_duedate

modify it_bsid index lv_tabix transporting duedate

endloop

Read only

Former Member
0 Likes
2,808

Hi Ri

you need define the tables as a parameter in your function module. you can see in SE37, there are many paramters, importing, exporting, tables, exceptions.

this tables parameter can return value to internal table when you call it.

Regards,

Archer

Read only

0 Likes
2,808

Hi Dengyong,

thank you for reply

but can you help me with an example ?

please I think I just need it an we will solve this.

Read only

Former Member
0 Likes
2,808

Your question is not clear..

You are creating a function module and you want to return an internal table....

In that case. Create a Table Type in data dictionary and use that as an export parameter.

Regards

Read only

0 Likes
2,808

hello Mohammed Yakub,

I am not create it,

I just use the standard function module from SAP.

my question is, how to get the value from function module and move it to internal table,

when I try to move it, it just move 1 value from 1 line. I need all value from all line. how to do it ?

Read only

Former Member
0 Likes
2,808

which FM u r using?

Read only

0 Likes
2,808

Hi Farid,

FM = NET_DUE_DATE_GET

Please help me T_T

Read only

0 Likes
2,808

are u trying update the same internal with due date that u have used when u r selecting data from BSIK?

Read only

harshsisodia31
Participant
0 Likes
2,808

hi

You just need to pass the value to the FM and FM will return the table with set of values now you need pass this table returned by FM to a internal table, for that you can just modify the internal table or append the internal table,

use below code for reference :

WHILE D1 LE D2.


       CALL FUNCTION 'BAPI_AR_ACC_GETOPENITEMS'
       EXPORTING
         COMPANYCODE       = PA_BUKRS
         CUSTOMER          = PA_KUN
         KEYDATE           = D1
         NOTEDITEMS        = 'X'
*       SECINDEX          = ' '
*     IMPORTING
*       RETURN            =
       TABLES
         LINEITEMS         = LT_ITMES.

ENDWHILE.


LOOP AT LT_ITMES INTO WA_ITMES.

       MOVE WA_ITMES-CLEAR_DATE  TO WA_BSID-AUGDT.
         MOVE WA_ITMES-COMP_CODE   TO WA_BSID-BUKRS.
         MOVE WA_ITMES-FISC_YEAR   TO WA_BSID-GJAHR.
         MOVE WA_ITMES-REF_DOC_NO  TO WA_BSID-XBLNR.
         MOVE WA_ITMES-ALLOC_NMBR  TO WA_BSID-ZUONR.
         MOVE WA_ITMES-DOC_NO      TO WA_BSID-BELNR.

         APPEND WA_BSID TO IT_BSID.
       ENDIF.



hope it helps.

Read only

Former Member
0 Likes
2,808

share your code...

Read only

Former Member
0 Likes
2,808

Hi Ri,

When you use the FM to get the due date giving the invoice document to the FM.

Try this out.

First create an internal table say for this case IT1, and assume that you have your Invoice Document in one internal table  say as IT

Now try looping the internal table IT which contain the Invoice Document and inside the loop use the function module from which you get due date and after fetching the due date from the FM  pass that data to the newly created internal table IT1  and append the internal table IT1.

Hope this will solve your problem

Regards

Rounak

Read only

Former Member
0 Likes
2,808

In your code

CTRL+F6 type in the function module, provide correct importing parameters, use in code.

Read only

Former Member
0 Likes
2,809

And go to ABAPDOCU, search for function module and look at the example provided by SAP

(also check DWDM for more basic abap examples)

Read only

Former Member
0 Likes
2,808

Hi All,

SOLVED !

Read only

0 Likes
2,808

Hello Ri,

If your problem has been solved. Kindly close the discussion.

Regards,

Chandni Sharma