ITPUB论坛 » SAP R/3 » 系统开发及跨应用设置 » 两个内表可以结合成一个内表么?
报名申请微软有影响力专家
2008-7-7 20:01 tieshou444
两个内表可以结合成一个内表么?

A表两个字段a1,a2.  输出结果:1   2
B表两个字段b1,b2.  输出结果:3   4

我声明一个C表字段为a1,a2,b1,b2.

C表能不能输出:1   2    3    4

2008-7-7 20:13 tieshou444
c表的值为一行输出,可以实现么?我没成功。

2008-7-7 20:58 ryq0000
关键是如何关联起来

2008-7-7 22:29 tieshou444
没关联字段可以做到么

2008-7-8 00:34 weddingmax
那如果这两个表都有多行数据怎么对应呢?
很感兴趣!

2008-7-8 08:34 dreamgift
[quote]原帖由 [i]tieshou444[/i] 于 2008-7-7 22:29 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10883335&ptid=1018154][img]http://www.itpub.net/images/common/back.gif[/img][/url]
没关联字段可以做到么 [/quote]


如果随便对应的话  应该可以实现.

2008-7-8 08:44 ryq0000
如果数字是连的,倒是可以的.LOOP再READ一下就可以了.
总之规则最重要.

2008-7-8 08:57 lulu1212
data:begin of itab1 occurs 0,
      a1 type c value '1',
      a2 type c value '2',
      end of itab1.
data:begin of itab2 occurs 0,
      b1 type c value '3',
      b2 type c value '4',
      end of itab2.
data:begin of itab3 occurs 0,
      a1 type c,
      a2 type c,
      b1 type c,
      b2 type c,
      end of itab3.
itab3-a1 = itab1-a1.
itab3-a2 = itab1-a2.
itab3-b1 = itab2-b1.
itab3-b2 = itab2-b2.
append itab3.
      
      write:/ itab1-a1,
              itab1-a2.
      write:/ itab2-b1,
              itab2-b2.
      write:/ itab3-a1,
              itab3-a2,
              itab3-b1,
              itab3-b2.
不知你是否想要这样?

2008-7-8 09:05 ryq0000
[quote]原帖由 [i]lulu1212[/i] 于 2008-7-8 08:57 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10884541&ptid=1018154][img]http://www.itpub.net/images/common/back.gif[/img][/url]
data:begin of itab1 occurs 0,
      a1 type c value '1',
      a2 type c value '2',
      end of itab1.
data:begin of itab2 occurs 0,
      b1 type c value '3',
      b2 type c value '4',
      end of itab2.
data:begin of itab3 occurs 0,
      a1 type c,
      a2 type c,
      b1 type c,
      b2 type c,
      end of itab3.
itab3-a1 = itab1-a1.
itab3-a2 = itab1-a2.
itab3-b1 = itab2-b1.
itab3-b2 = itab2-b2.
append itab3.
      
      write:/ itab1-a1,
              itab1-a2.
      write:/ itab2-b1,
              itab2-b2.
      write:/ itab3-a1,
              itab3-a2,
              itab3-b1,
              itab3-b2.
不知你是否想要这样? [/quote]
你这是一行,多行呢?
肯定不是这样的.

2008-7-8 09:05 robinho_lu
[quote]原帖由 [i]lulu1212[/i] 于 2008-7-8 08:57 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10884541&ptid=1018154][img]http://www.itpub.net/images/common/back.gif[/img][/url]
data:begin of itab1 occurs 0,
      a1 type c value '1',
      a2 type c value '2',
      end of itab1.
data:begin of itab2 occurs 0,
      b1 type c value '3',
      b2 type c value '4',
      end of itab2.
data:begin of itab3 occurs 0,
      a1 type c,
      a2 type c,
      b1 type c,
      b2 type c,
      end of itab3.
itab3-a1 = itab1-a1.
itab3-a2 = itab1-a2.
itab3-b1 = itab2-b1.
itab3-b2 = itab2-b2.
append itab3.
      
      write:/ itab1-a1,
              itab1-a2.
      write:/ itab2-b1,
              itab2-b2.
      write:/ itab3-a1,
              itab3-a2,
              itab3-b1,
              itab3-b2.
不知你是否想要这样? [/quote]
:right:

2008-7-8 09:52 风中之沙
[quote]原帖由 [i]tieshou444[/i] 于 2008-7-7 22:29 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10883335&ptid=1018154][img]http://www.itpub.net/images/common/back.gif[/img][/url]
没关联字段可以做到么 [/quote]


沒有关联字段,連接起來做什么
:o

2008-7-8 11:36 hikarulea
[quote]原帖由 [i]lulu1212[/i] 于 2008-7-8 08:57 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10884541&ptid=1018154][img]http://www.itpub.net/images/common/back.gif[/img][/url]
data:begin of itab1 occurs 0,
      a1 type c value '1',
      a2 type c value '2',
      end of itab1.
data:begin of itab2 occurs 0,
      b1 type c value '3',
      b2 type c value '4',
      end of itab2.
data:begin of itab3 occurs 0,
      a1 type c,
      a2 type c,
      b1 type c,
      b2 type c,
      end of itab3.
itab3-a1 = itab1-a1.
itab3-a2 = itab1-a2.
itab3-b1 = itab2-b1.
itab3-b2 = itab2-b2.
append itab3.
      
      write:/ itab1-a1,
              itab1-a2.
      write:/ itab2-b1,
              itab2-b2.
      write:/ itab3-a1,
              itab3-a2,
              itab3-b1,
              itab3-b2.
不知你是否想要这样? [/quote]

itab1和itab2只是一行,且按行对应话,感觉这个没问题。3个write分别用一行显示了itab1、itab2、itab3的内容。

如果itab1和itab2是多行的话,就要loop+read了。loop哪个也需要判断下。

2008-7-8 15:05 tieshou444
我是想把两个表放在一个表中,然后用smartforms输出出来,遇到瓶颈。

2008-7-8 15:50 dreamgift
[quote]原帖由 [i]tieshou444[/i] 于 2008-7-8 15:05 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10889316&ptid=1018154][img]http://www.itpub.net/images/common/back.gif[/img][/url]
我是想把两个表放在一个表中,然后用smartforms输出出来,遇到瓶颈。 [/quote]


没有联系你传过去又怎么样?

你要单纯的想传过去2个表的数据.

可以一起直接传2个表过去.

到SMARTFORMS里想怎么操作再怎么操作不好~?

2008-7-8 16:42 ryq0000
[quote]原帖由 [i]hikarulea[/i] 于 2008-7-8 11:36 发表 [url=http://www.itpub.net/redirect.php?goto=findpost&pid=10886673&ptid=1018154][img]http://www.itpub.net/images/common/back.gif[/img][/url]


itab1和itab2只是一行,且按行对应话,感觉这个没问题。3个write分别用一行显示了itab1、itab2、itab3的内容。

如果itab1和itab2是多行的话,就要loop+read了。loop哪个也需要判断下。 [/quote]
:right:

页: [1]


Powered by ITPUB论坛